Exp 8
Exp 8
CLASS – CS-B-04
ROLL NO – 124102065
EXPERIMENT 8
<!DOCTYPE html>
<html>
<head>
<title>Registration Page Validation</title>
<style>
body {
font-family: Arial, sans-serif;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100vh;
background: linear-gradient(to right, #ff7e5f, #feb47b);
color: white;
}
.container {
background: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
width: 350px;
text-align: center;
color: #333;
}
h2 {
margin-bottom: 20px;
}
label {
display: block;
text-align: left;
font-weight: bold;
margin: 10px 0 5px;
}
input[type="text"],
input[type="password"] {
width: 100%;
padding: 10px;
border: 1px solid #ccc;
border-radius: 5px;
box-sizing: border-box;
margin-bottom: 10px;
}
input[type="submit"] {
background-color: #ff5733;
color: white;
padding: 10px 15px;
border: none;
border-radius: 5px;
cursor: pointer;
width: 100%;
font-weight: bold;
transition: background 0.3s;
}
input[type="submit"]:hover {
background-color: #c70039;
}
</style>
<script>
function validateRegistration() {
let name = document.getElementById("name").value.trim();
let email = document.getElementById("email").value.trim();
let password = document.getElementById("password").value.trim();
let confirmPassword =
document.getElementById("confirmPassword").value.trim();
let errorMessage = "";
<label for="email">Email:</label>
<input type="text" id="email" name="email" required>
<label for="password">Password:</label>
<input type="password" id="password" name="password" required>