The HTML 4.01 specification introduced a number of new attributes that make form elements more accessible and easier to use. As of this writing, they are still poorly supported by most browsers, but they do reveal the W3C's thinking regarding forms. Some attributes take into account efforts to improve accessibility and internationalization. Some can be used with Dynamic HTML to make form elements turn on and off, or become hidden or visible based on user input. Table 15-1 lists the new attributes along with the form elements to which they can be applied.
Attribute |
Description |
Related tag(s) |
---|---|---|
Specifies the list of character encodings (character sets) that must be accepted by the server processing the form. This attribute is part of the W3C's internationalization efforts requiring alternative character sets to represent non-western writing systems. (This attribute is not widely supported.) |
<FORM> |
|
Assigns an access key (keyboard shortcut) to an element for quicker access. |
<BUTTON>, <INPUT>, <LABEL>, <LEGEND>, <TEXTAREA> |
|
Disables the control for user input. It can only be altered via a script. Browsers may display disabled controls differently (grayed out, for example), which could be useful for dimming certain controls until required info is supplied. |
<BUTTON>, <INPUT>, <OPTGROUP>, <OPTION>, <SELECT>, <TEXTAREA> |
|
Prevents the user from changing the text in a field. |
<INPUT type=text>, <INPUT type=password>, <TEXTAREA> |
|
Specifies position in the tabbing order. Tabbing navigation allows the user to cycle through the active fields using the Tab key. |
<BUTTON>, <INPUT>, <SELECT>, <TEXTAREA> |
Copyright © 2002 O'Reilly & Associates. All rights reserved.