Html Forms
1) Forms are used to collect some data from users.
2) A form will take input from user and it will store data in back end application.
3) There are various form elements in html such as text boxes, text area fields, drop down menu, check boxes, radio buttons,file etc.
4) <form> tag is used to create a form in html.
Syntax :
<form name="form1"> </form>
<form name="form1"> </form>
Form Attributes :
- Action attribute is to mention another resource,which is used to process user data after submitting.
- Method is used to uploading data in two ways.one is GET and another one is POST.
- By using GET
- we can send a limited amount of data.
- It will be visible in URL bar that's why it is not secure.
- By using POST
- we can send large amount of data without any limitations.
- It won't visible in URL bar that's why it more secure.
Form Controls :
- Text Input Controls
- Check Box Controls
- Radio Button Controls
- Hidden Controls
- Text Area Control
- submit Button Controls
Code :

Output :
Creating A Student Form :
- Creating a form to collect student data like name,email id, gender, mobile number, address,country,hobbies,qualification.
- Text input type is used to read text data from student.
- Date input type is used to read date of birth of student.
- Number type is used to read mobile number.
- Text area is used to read a paragraph like address.
- Button type is used to submit data.
Code:
Output:
Creating Teacher Form :
Code :
Output :
Designing any real time sample form with 2 text boxes, radio button, check boxes and a button to submit the form.
Code :
- To create login form i used text boxes,radio buttons, check boxes,submit button and hyperlink.\
- The <input> tag specifies an input field where the user can enter data.
- <input> elements are used within a <form> element to declare input controls that allow users to input data.
- <input type="text"> represents a one-line text input field.
- <input type="password"> represents a password field.
- <input type="submit"> represents a button for submitting form data.
- <input type="radio"> represents a radio button.
Output :