This chapter includes an additional tutorial of HTML5 Form Attributes, Which is containing the related attribute of Form Element.
The Form Attributes gives some extra controll on Form Element. An individual can implement some addtional feature to manipulate more advantages of Form Element.
It has mainly two attributes, has been described below:
✔ autocomplete
✔ novalidate
Where autocomplete attribute is used to provide an autocompletion option to user, when user visit the form page. If autocompletion is on, it will autocomplete the form and if autocompletion is off, the user have to fill the form field mannual.
It is possible to have autocomplete "on" and "off" for the form, and "off" and "on" for specific input fields.
Note: The autocomplete attribute works with <form> and the following <input> types:
✔ text
✔ search
✔ url
✔ tel
✔ password
✔ datepickers
✔ color
Supported Browser
Below is complete syntax along with example
<!DOCTYPE html> <html> <head> <title>Title name will go here</title> </head> <body> <form action="demo_form.php" autocomplete="on"> First name:<input type="text" name="fname"><br> Last name: <input type="text" name="lname"><br> E-mail: <input type="email" name="email" autocomplete="off"> Phone: <input type="text" name="text" autocomplete="off"><br> <input type="submit"> </form> </body> </html>
Where novalidate attribute is used to send the information for not validating the form field. It specifies that form data shouldn't be validated.
Supported Browser
Below is complete syntax along with example
<!DOCTYPE html> <html> <head> <title>Title name will go here</title> </head> <body> <form action="demo_form.php" novalidate> E-mail: <input type="email" name="email" autocomplete="off"> <input type="submit"> </form> </body> </html>