HTML5 Form Attributes / PDF
Sample of the pdf document :
HTML5 New Form Attributes
HTML5 has several new attributes for <form> and <input>.
New attributes for
<form>:
- autocomplete
- novalidate
New attributes for
<input>:
- autocomplete
- autofocus
- form
- formaction
- formenctype
- formmethod
- formnovalidate
- formtarget
- height and width
- list
- min and max
- multiple
- pattern (regexp)
- placeholder
- required
- step
<form> / <input> autocomplete Attribute
The autocomplete attribute specifies whether a form or input field should
have autocomplete on or off.
When autocomplete is on, the browser automatically complete values based on
values that the user has entered before.
Tip: It is possible to have autocomplete "on" for
the form, and "off" for specific input fields, or vice versa.
Note: The autocomplete attribute works with <form> and
the following <input> types: text, search, url, tel, email, password,
datepickers, range, and color.
Example
An HTML form with autocomplete on (and off for one
input field):
<form
action="demo_form.asp" 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"><br>
<input type="submit">
</form>
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"><br>
<input type="submit">
</form>
Tip: In some browsers you may need to activate the
autocomplete function for this to work.
<form> novalidate Attribute
The novalidate attribute is a boolean attribute.
When present, it specifies that the form-data (input) should not be
validated when submitted.
Example
Indicates that the form is not to be validated on
submit:
<form
action="demo_form.asp" novalidate="novalidate">
E-mail: <input type="email" name="user_email">
<input type="submit">
</form>
E-mail: <input type="email" name="user_email">
<input type="submit">
</form>
<input> autofocus Attribute
The autofocus attribute is a boolean attribute.
When present, it specifies that an <input> element should
automatically get focus when the page loads.
Example
Let the "First name" input field
automatically get focus when the page loads:
First name:<input
type="text" name="fname"
autofocus="autofocus">
<input> form Attribute
The form attribute specifies one or more forms an <input> element
belongs to.
Tip: To refer to more than one form, use a space-separated
list of form ids.
Example
An input field located outside .......
0 commentaires: