0% found this document useful (0 votes)
21 views5 pages

2c. Registration Form

The document provides a complete HTML program for a registration form that includes various input fields such as text, password, number, date, checkboxes, radio buttons, and a dropdown list. It uses a table layout for better organization and includes submit and reset buttons. The form is styled with CSS for improved visual presentation.

Uploaded by

manju101913
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views5 pages

2c. Registration Form

The document provides a complete HTML program for a registration form that includes various input fields such as text, password, number, date, checkboxes, radio buttons, and a dropdown list. It uses a table layout for better organization and includes submit and reset buttons. The form is styled with CSS for improved visual presentation.

Uploaded by

manju101913
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

2c.

Write a HTML program, to explain the working of forms by


designing Registration form. (Note: Include text field, password field,
number field, date of birth field, checkboxes, radio buttons, list boxes
using <select>&<option> tags, <text area> and two buttons ie: submit
and reset. Use tables to provide a better view).
Aim: To create HTML program to the working of forms by designing
Registration form.
Source Code:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-
scale=1.0">
<title>Registration Form</title>
<style>
table {
width: 50%;
margin: 20px auto;
border-collapse: collapse;
}
th, td {
padding: 10px;
border: 1px solid #c53737;
text-align: left;
}
th {
background-color: #d1a5a5;
}
</style>
</head>
<body>

<h2 style="text-align:center;">Registration Form</h2>

<form action="#" method="post">


<table>
<tr>
<th><label for="fullname">Full Name:</label></th>
<td><input type="text" id="fullname" name="fullname"
required></td>
</tr>
<tr>
<th><label for="password">Password:</label></th>
<td><input type="password" id="password"
name="password" required></td>
</tr>
<tr>
<th><label for="age">Age:</label></th>
<td><input type="number" id="age" name="age" min="1"
max="120" required></td>
</tr>
<tr>
<th><label for="dob">Date of Birth:</label></th>
<td><input type="date" id="dob" name="dob" required></td>
</tr>
<tr>
<th>Gender:</th>
<td>
<input type="radio" id="male" name="gender"
value="male" required>
<label for="male">Male</label>
<input type="radio" id="female" name="gender"
value="female">
<label for="female">Female</label>
</td>
</tr>
<tr>
<th>Hobbies:</th>
<td>
<input type="checkbox" id="reading" name="hobbies"
value="reading">
<label for="reading">Reading</label>
<input type="checkbox" id="traveling" name="hobbies"
value="traveling">
<label for="traveling">Traveling</label>
<input type="checkbox" id="sports" name="hobbies"
value="sports">
<label for="sports">Sports</label>
</td>
</tr>
<tr>
<th><label for="country">Country:</label></th>
<td>
<select id="country" name="country">
<option value="usa">USA</option>
<option value="canada">Canada</option>
<option value="uk">UK</option>
<option value="australia">Australia</option>
</select>
</td>
</tr>
<tr>
<th><label for="comments">Comments:</label></th>
<td><textarea id="comments" name="comments" rows="4"
cols="30"></textarea></td>
</tr>
<tr>
<td colspan="2" style="text-align:center;">
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
Output:

You might also like