Attributes are like properties that acts some specific funtion in the tag. There are different attributes for different html tags. But today we are going to talk about the form attributes of HTML 5. There is two new form attributes that are induced for html 5.
And input attributes are:
autocomplete, autofocus, formaction, form, formmethod, formenctype, formnovalidate, formtarget, height, width, list, min, max, multiple, pattern, required, placeholder step etc.]
<form autocomplete="on" action="radhika.html" name="form">
Name:<input type="text" name="firstname"><br>
Surname: <input type="text" name="lastname"><br>
E-mail Address: <input type="email" autocomplete="off" name="email_address"><br>
<input type="submit" name="submit">
</form>
novalid attribute:- It is used not to valid the input data. The syntax of novalidate attribute is given below:
<form name="form" action="rakesh.html" novalidate>
Username: <input type="text" name="name"/>
</form>
Better Name: <input type="text" name="better" autofocus>
Email: <input type="email" name="email" form="second_form">
- autocomplete
- novalidate
And input attributes are:
autocomplete, autofocus, formaction, form, formmethod, formenctype, formnovalidate, formtarget, height, width, list, min, max, multiple, pattern, required, placeholder step etc.]
autocomplete attribute:- autocomplete attribute is used to specify whether input field is On for autocomplete the fields or not.
It should be noted that autocomplete attribute is on for form but off for the email field. It works with input, form, password, text, datepicker, color and also range. Lets see an example how to use autocomplete attibute in form and form elements.<form autocomplete="on" action="radhika.html" name="form">
Name:<input type="text" name="firstname"><br>
Surname: <input type="text" name="lastname"><br>
E-mail Address: <input type="email" autocomplete="off" name="email_address"><br>
<input type="submit" name="submit">
</form>
novalid attribute:- It is used not to valid the input data. The syntax of novalidate attribute is given below:
<form name="form" action="rakesh.html" novalidate>
Username: <input type="text" name="name"/>
</form>
- autofocus attribute:- It is also a boolean attribute. It is used to focus automatically when the page is loaded. The given syntax shows you how you can use this attribute.
Better Name: <input type="text" name="better" autofocus>
- Form attrbute:- form attribute is used ot define one or more than one forms in the form tag.
Email: <input type="email" name="email" form="second_form">
- formaction:- formaction attribute overrides the action attribute of form when the form is submitted.
- formmethod attribute:- Like the formaction, it does same but it overrides the method of form. Its syntax is same like the formaction and it is used also same place.
- formtarget:- Likewise the formmethod and formaction, it overrisdes the target of form.
- height an width:- This attribute is used to define the height and width of the type input.
- list:- List attrbute is used to list out the elements of type input.
- min and max:- min attribute is used to define minimum value of type input and max is used to define max value.
- multiple:- This is used to define those input who has multiple value like email , image.
- pattern:- pattern is used for validation of type of input.
- placeholder:- placeholder is used for hint.
- required:- It is used to make the field necessary to fill out.
Post a Comment