input Elements


 

The input element is declared by the XHTML 1.1 Forms Module

There are ten types of input element, all of which are form controls. Each performs a significantly different function, however, and are listed below in alphabetical order:

input type="button"A form push-button (with no default action)
input type="checkbox"A checkbox (may be checked or unchecked independently of other form controls)
input type="file"A file upload control
input type="hidden"A hidden input parameter
input type="image"A graphical form submit button
input type="password"A password input field
input type="radio"A radio button (only one of a set of radio buttons can be "on" at any one time)
input type="reset"A form reset button
input type="submit"A form submit button
input type="text"A text input field

If specified, the type attribute of the input element must have one of the values above (although the values "button", "file" and "image" are not allowed if using the *W3C XHTML 1.1 Basic Forms Module). If omitted, the default value of "text" is assumed.

In addition to the type attribute (and to all the standard Common Attributes) there are a number of specific attributes declared on input elements. These attributes are listed in the first column of the table below and will validate on any input element but, due to the vastly differing functions of these elements, most of the attributes have meaning only on a certain number of them. The table shows which of the attributes are actually applicable (in a reliable fashion) to which of the elements. Note that disabled and readonly are not allowed if you are using the *W3C XHTML 1.1 Basic Forms Module.

Table detailing which specific attributes are applicable to which of the above input elements.
Attribute text password checkbox radio submit reset hidden button file image
name YESYESYESYESYESYESYESYESYESYES
value YESYESYESYESYESYESYESYESNONO
disabled YESYESYESYESYESYESYESYESYESYES
readonly YESYESNONONONONONONONO
size YESYESNONONONONONOYESNO
maxlength YESYESNONONONONONONONO
checked NONOYESYESNONONONONONO
accept NONONONONONONONOYESNO
src NONONONONONONONONOYES
alt NONONONONONONONONOYES
ismap NONONONONONONONONOYES
usemap NONONONONONONONONOYES
accesskey YESYESYESYESYESYESNOYESYESYES
tabindex YESYESYESYESYESYESNOYESYESYES
onfocus YESYESYESYESYESYESNOYESYESYES
onblur YESYESYESYESYESYESNOYESYESYES
onchange YESYESYESYESNONONONOYESNO
onselect YESYESNONONONONONOYESNO

Page Footer & Copyright

Copyright © Sally Maughan 2005-2009 (Page last updated on 01 Oct 2009)

*Valid XHTML 1.1 - hosted by *Openstrike

Content based on the W3C Working Draft: *XHTML 1.1 and Recommendation: *XHTML Modularisation 1.1.

W3C, XHTML, XML, HTML, CSS and MathML are *Trademarks of the W3C (*MIT, *ERCIM, *Keio) with which the site's author has no connection.


Up, Next & Previous Links

Your Location

Home > XHTML 1.1 Home > XHTML 1.1 Indexes > Element Index (XHTML 1.1) > input Elements