Registration Page
SOLUTION....
<!DOCTYPE html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title>Register</title>
<link rel=”stylesheet” href=”https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css”>
<script>
function validateRegister() {
let name = document.getElementById(“name”).value;
let email = document.getElementById(“email”).value;
let pass = document.getElementById(“password”).value;
let confirm = document.getElementById(“confirm”).value;
if (name == “” || email == “” || pass == “”) {
alert(“All fields are required!”);
return false;
}
if (pass !== confirm) {
alert(“Passwords do not match!”);
return false;
}
alert(“Registration Successful!”);
return true;
}
</script>
</head>
<body>
<div class=”container mt-5″>
<h2>Registration Form</h2>
<form onsubmit=”return validateRegister()”>
<div class=”form-group”>
<label>Name:</label>
<input type=”text” id=”name” class=”form-control”>
</div>
<div class=”form-group”>
<label>Email:</label>
<input type=”email” id=”email” class=”form-control”>
</div>
<div class=”form-group”>
<label>Password:</label>
<input type=”password” id=”password” class=”form-control”>
</div>
<div class=”form-group”>
<label>Confirm Password:</label>
<input type=”password” id=”confirm” class=”form-control”>
</div>
<button type=”submit” class=”btn btn-success”>Register</button>
</form>
</div>
</body>
</html>