0% found this document useful (0 votes)
9 views2 pages

HTML Form Fields Summary

The document provides a summary of various HTML form fields including text fields, password fields, and checkboxes. It includes examples of each type of field along with their corresponding HTML code. Additionally, it presents a complete form that incorporates all these fields for user input.

Uploaded by

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

HTML Form Fields Summary

The document provides a summary of various HTML form fields including text fields, password fields, and checkboxes. It includes examples of each type of field along with their corresponding HTML code. Additionally, it presents a complete form that incorporates all these fields for user input.

Uploaded by

achauhan1787
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

HTML Form Fields Summary

1. Text Field:

- Used to take simple text input like name or email.

- HTML Code:

<input type="text" name="username">

Example:

<form>

<label for="name">Name:</label><br>

<input type="text" id="name" name="name">

</form>

2. Password Field:

- Used to take hidden input (dots/stars), usually for passwords.

- HTML Code:

<input type="password" name="password">

Example:

<form>

<label for="password">Password:</label><br>

<input type="password" id="password" name="password">

</form>

3. Checkbox Field:

- Used when user can select one or more options.

- HTML Code:

<input type="checkbox" name="hobby" value="reading"> Reading

Example:

<form>

<p>Select your hobbies:</p>

<input type="checkbox" name="hobby" value="reading"> Reading<br>

<input type="checkbox" name="hobby" value="music"> Music<br>

<input type="checkbox" name="hobby" value="sports"> Sports


</form>

4. All Fields Together:

<form action="submit.php" method="post">

<label for="username">Username:</label><br>

<input type="text" id="username" name="username"><br><br>

<label for="password">Password:</label><br>

<input type="password" id="password" name="password"><br><br>

<p>Select your hobbies:</p>

<input type="checkbox" name="hobby" value="reading"> Reading<br>

<input type="checkbox" name="hobby" value="music"> Music<br>

<input type="checkbox" name="hobby" value="sports"> Sports<br><br>

<input type="submit" value="Submit">

</form>

You might also like