91-9990449935 0120-4256464 |
HTML FormAn HTML form is a section of a document which contains controls such as text fields, password fields, checkboxes, radio buttons, submit button, menus etc. An HTML form facilitates the user to enter data that is to be sent to the server for processing. Why use HTML FormHTML forms are required if you want to collect some data from of the site visitor. For example: If a user want to purchase some items on internet, he/she must fill the form such as shipping address and credit/debit card details so that item can be sent to the given address. HTML Form SyntaxHTML Form TagsLet's see the list of HTML 5 form tags.
HTML 5 Form TagsLet's see the list of HTML 5 form tags.
HTML TextField ControlThe type="text" attribute of input tag creates textfield control also known as single line textfield control. The name attribute is optional, but it is required for the server side component such as JSP, ASP, PHP etc. Label Tag in FormIt is considered better to have label in form. As it makes the code parser/browser/user friendly. If you click on the label tag, it will focus on the text control. To do so, you need to have for attribute in label tag that must be same as id attribute of input tag. HTML Password Field ControlThe password is not visible to the user in password field control. HTML 5 Email Field ControlThe email field in new in HTML 5. It validates the text for correct email address. You must use @ and . in this field. Radio Button ControlThe radio button is used to select one from multiple options. It is used in gender, quiz questions etc. If you use one name for all the radio buttons, only one radio button can be selected at a time. Checkbox ControlThe checkbox control is used to check multiple options from given checkboxes. HTML Form ExampleLet's see a simple example of creating HTML form. Test it NowSupporting Browsers
Next TopicMarquee in HTML
|