New Commands in HTML 5 – Forms

Web Browser support for HTML 5 support is increasing at an ever increasing pace. HTML 5 provides several new design elements for website forms by adding new tags and improving old ones. The INPUT tag has several new attributes and input types. Some attributes remove the need for cumbersome JavaScript scripts for form validation, and others simply make the forms easier to use.

New INPUT Tag Attributes

autocomplete – Values: ON/OFF: Tells the web browser to either auto-fill the form field if the user returns to the page using previous data, or to disable the feature.

autofocus – Values: AUTOFOCUS: This tells the web browser to give focus to this field upon page load

pattern – Values: pattern: This allows for the web browser to automatically validate the field’s contents based upon the regular expression supplied (i.e. [0-9] means only numeric characters are accepted)

placeholder – Values: text: This tells the browser to display the text supplied when the field is empty. The text will be slightly lighter in color than the regular text color to indicate that it is a placeholder.

required – Values: required: Defined field is required for the submission of its form.

New INPUT Tag Input Types

color – only color values
date – only date values
datetime – only timestamps [HH:MM:
datetime-local – Only timestamps in local time format
email – Only e-mail addresses
month – Only months
number – Only numeric characters; no text values
range – Range of values
tel – Only telephone numbers
time – Only time values
url – Only URLs
week – Only week values


2 Trackbacks/Pingbacks

  1. Alexander 07 07 11
  2. Alexander7 23 07 11

Add Your Comment