<input>
control can turn off data validation using the
formnovalidate
attribute
<input type="submit" value="Submit without validation" formnovalidate>
novalidate
attribute:
<form action="purchase.php" novalidate>
required
attribute means a value for the control must be supplied
or the browser will not allow the form to be submitted
<!-- User MUST enter something here -->
<input type="text" required>
pattern
attribute for supplying a regular
expression which the input must match
<!-- Text box only accepts 4 digits -->
<input type="text" pattern="^\d\d\d\d$">
autofocus
attribute gives the control the focus when the page
is loading, and only one control per page can use it
<!-- Text box has focus when page is first loaded -->
<input type="text" autofocus>
placeholder
attribute gives "hints" to the user as to what is
expected to be typed into a text box
<!-- "Name" appears in text box -->
<input type="text" placeholder="Name">
<input type="color">
(#RRGGBB value)
<input type="date" required>
(yyyy-mm-dd)
<input type="datetime" placeholder="yyyy-mm-ddThh:mm" />
(Example: 2012-08-15T14:20)
<input type="datetime-local" placeholder="yyyy-mm-ddThh:mm" />
(Example: 2012-08-15T14:20)
<input type="month" placeholder="yyyy-mm">
(Example: 2012-05)
nn
is number between 01 and 53)
<input type="week" placeholder="yyyy-Wmm" />
(Example: 2012-W01)
min
and max
<input type="number" min="1" max="10" step="1">
min
and max
(slider control)
<input type="range" min="0" max="50" value="25">
<input type="email" placeholder="name@domain.com">
(Example: joe@yahoo.com)
<input type="tel" placeholder="(###) ###-####" pattern="\(\d{3}\) +\d{3}-\d{4}">
(Example: (303) 761-9719)
<input type="url" placeholder="http://domain.com/">
(Example: http://www.yahoo.com/)
<input type="search" placeholder="Search">
<input autocomplete="on">
to turn on ability of browser to fill-in fields that you have previously supplied
name
or id
attribute for it to work
autocomplete="off"
for
private information like passwords
<datalist>
tag to supply an input element with
pre-defined values that appear as user is typing
<input list="browsers">
<datalist id="browsers">
<option value="Internet Explorer">
<option value="Firefox">
<option value="Chrome">
<option value="Opera">
<option value="Safari">
</datalist>