IE10 includes support for HTML5 Forms. HTML5 Forms offers two major advantages over previous versions: new input types and built in validation.
The new HTML5 input types are:
Introducing New Input Types
The current draft of the HTML5 specification brings with it 13 new
input
field types. Yes, thirteenbrand-new, shiny ways of defining the good old input
element, so make some room beside text
inputs for the following:email
for email addresses, perfect to use immediatelytel
for telephone numbers (some browsers may strip whitespace), fine for immediate useurl
for web addresses, good to use nowcolor
for hexadecimal color values; here’s hoping we see OS-native color pickers in the future!number
for whole numbers; some browsers provide up/down arrows next to the input field. You can also limit the number to a given range with themin
andmax
attributes.range
for a numeric input with a slider widget; like thenumber
input type, you can usemin
andmax
attributes to define the range. You can also use thestep
attribute to control the increments in which the slider moves. This is ready for use, as browsers that don’t support it will simply display a text field—but be careful how you use this one. Regardless of how cool they may look, sliders are only good for certain tasks (such as price ranges); in most cases, a regular number field will be easier for your users.search
for search keywords, so naturally just the tool for site searches. Be wary of the current Mac OS rendering: it looks just like the built-in Spotlight search, but there’s no overriding the styles if you need to display it differently.date
,month
,week
,time
,datetime
, anddatetime-local
for date-related inputs. Several exciting new fields—now we just have to wait for all the browsers to implement it.
HTML5 form attributes
- There are 14 new attributes Is as follows,
- placeholder, autofocus, autocomplete, required, pattern, list,multiple, novalidate, formnovalidate, form
Good Luck…
No comments:
Post a Comment