# *Assignment: Forms in HTML*
## *Student Name:* ____
## *Class & Section:* ___
## *Roll No.:* ___
## *Subject:* Computer / IT
## *School Name:* ____
## *Teacher’s Name:* ____
---
## *1. Introduction to HTML Forms*
An *HTML form* is used to collect input from users and send the data to a server for
processing. Forms are commonly used for *login pages, registration forms, feedback forms,
and surveys*.
HTML forms are created using the <form> tag along with different *input elements*.
---
## *2. Uses of HTML Forms*
HTML forms are used to:
* Collect user information
* Create login and sign-up pages
* Submit feedback or queries
* Conduct online surveys
* Process online orders
---
## *3. Structure of an HTML Form*
The basic structure of an HTML form is:
html
<form action="[Link]" method="post">
Form elements
</form>
* *action* – Specifies where form data is sent
* *method* – Specifies how data is sent (GET or POST)
---
## *4. Common Form Elements*
### (a) Input Field
html
<input type="text">
### (b) Password Field
html
<input type="password">
### (c) Radio Button
html
<input type="radio">
### (d) Checkbox
html
<input type="checkbox">
### (e) Submit Button
html
<input type="submit">
### (f) Reset Button
html
<input type="reset">
### (g) Text Area
html
<textarea></textarea>
### (h) Drop-down List
html
<select>
<option>Option 1</option>
</select>
---
## *5. Example of an HTML Form*
html
<html>
<head>
<title>Student Registration Form</title>
</head>
<body>
<h2>Student Registration Form</h2>
<form>
Name: <input type="text"><br><br>
Password: <input type="password"><br><br>
Gender:
<input type="radio" name="g"> Male
<input type="radio" name="g"> Female<br><br>
Subjects:
<input type="checkbox"> Maths
<input type="checkbox"> Science
<input type="checkbox"> Computer<br><br>
City:
<select>
<option>Delhi</option>
<option>Mumbai</option>
<option>Chennai</option>
</select><br><br>
Address:<br>
<textarea rows="4" cols="30"></textarea><br><br>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
---
## *6. Attributes of <input> Tag*
* *type* – Defines input type
* *name* – Identifies form data
* *value* – Default value
* *placeholder* – Hint text
* *required* – Mandatory field
---
## *7. GET vs POST Method*
| GET Method | POST Method |
| ------------------- | -------------- |
| Data visible in URL | Data hidden |
| Less secure | More secure |
| Limited data | Large data |
| Used for search | Used for forms |
---
## *8. Advantages of HTML Forms*
* Easy to use
* Interactive
* Saves time
* Collects structured data
* Widely supported
---
## *9. Conclusion*
HTML forms are an essential part of web development. They allow websites to interact with
users and collect important data. Learning forms helps students understand how real-world
websites work.
---
## *10. Acknowledgement*
I would like to thank my teacher for guidance and my parents for support in completing this
assignment.
---
*Submitted By:* ____
*Date:* ____