Program4
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Registration Form</title>
<style>
/* Basic styling for the page */
body {
font-family: Arial, sans-serif;
background-color: #f4f4f9;
color: #333;
margin: 0;
padding: 20px;
}
h1 {
text-align: center;
color: #4CAF50;
font-size: 36px;
}
/* Table for form layout */
table {
width: 60%;
margin: 0 auto;
border-collapse: collapse;
}
td {
padding: 10px;
font-size: 16px;
}
/* Styling for input fields and labels */
input[type="text"], input[type="email"], input[type="password"],
select {
width: 100%;
padding: 8px;
border: 1px solid #ccc;
border-radius: 4px;
background-color: #f9f9f9;
}
input[type="radio"], input[type="checkbox"] {
margin-right: 10px;
}
input[type="submit"] {
background-color: #4CAF50;
color: white;
border: none;
padding: 12px 20px;
font-size: 18px;
cursor: pointer;
border-radius: 5px;
width: 100%;
}
input[type="submit"]:hover {
background-color: #45a049;
}
/* Style for form section headers */
.form-section {
background-color: #e2f1e3;
padding: 10px;
margin-bottom: 10px;
font-weight: bold;
text-align: center;
}
/* Style for error messages */
.error {
color: red;
font-size: 14px;
}
</style>
</head>
<body>
<h1>User Registration Form</h1>
<form action="#" method="post">
<!-- User Information Section -->
<div class="form-section">Personal Information</div>
<table>
<tr>
<td><label for="firstName">First Name:</label></td>
<td><input type="text" id="firstName" name="firstName"
required></td>
</tr>
<tr>
<td><label for="lastName">Last Name:</label></td>
<td><input type="text" id="lastName" name="lastName"
required></td>
</tr>
<tr>
<td><label for="email">Email Address:</label></td>
<td><input type="email" id="email" name="email" required></td>
</tr>
<tr>
<td><label for="dob">Date of Birth:</label></td>
<td><input type="date" id="dob" name="dob" required></td>
</tr>
</table>
<!-- Gender Section -->
<div class="form-section">Gender</div>
<table>
<tr>
<td><label>Gender:</label></td>
<td>
<input type="radio" id="male" name="gender"
value="Male"><label for="male">Male</label>
<input type="radio" id="female" name="gender"
value="Female"><label for="female">Female</label>
<input type="radio" id="other" name="gender"
value="Other"><label for="other">Other</label>
</td>
</tr>
</table>
<!-- Subscription Section -->
<div class="form-section">Subscription</div>
<table>
<tr>
<td><label>Would you like to subscribe to our
newsletter?</label></td>
<td>
<input type="checkbox" id="subscribe" name="subscribe"
value="Yes">
<label for="subscribe">Yes, subscribe me to the
newsletter</label>
</td>
</tr>
</table>
<!-- Country Selection Section -->
<div class="form-section">Country</div>
<table>
<tr>
<td><label for="country">Select Country:</label></td>
<td>
<select id="country" name="country">
<option value="usa">United States</option>
<option value="canada">Canada</option>
<option value="uk">United Kingdom</option>
<option value="india">India</option>
<option value="australia">Australia</option>
</select>
</td>
</tr>
</table>
<!-- Password Section -->
<div class="form-section">Account Information</div>
<table>
<tr>
<td><label for="password">Password:</label></td>
<td><input type="password" id="password" name="password"
required></td>
</tr>
<tr>
<td><label for="confirmPassword">Confirm
Password:</label></td>
<td><input type="password" id="confirmPassword"
name="confirmPassword" required></td>
</tr>
</table>
<!-- Submit Button -->
<div>
<input type="submit" value="Register">
</div>
</form>
</body>
</html>
Comments
Post a Comment