name / id attribute usage

There is a great deal of confusion surrounding the appropriate usage of the
'name' and 'id' attributes.  As you are probably aware, some existing
(popular) user agents do not properly treat the 'id' value as the control
name of a form element (e.g. 'input'), so it is a practicaly necessity to
use the 'name' attribute.  By the same token, the id attribute must be used
to identify elements for styling purposes.

In 12.2.3 of HTML 4.01 it says (regarding the 'name' and 'id' attributes):
"It is permissible to use both attributes to specify an element's unique
identifier for the following elements: A, APPLET, FORM, FRAME, IFRAME, IMG,
and MAP."

This section is about fragment identifiers.  Although it does not say so,
is this statement true only in context when using 'name' / 'id' to create
fragment identifiers?  Or is it true in general, precluding the
simultaneous use of 'name' and 'id' on, say, an 'input' element?

If that is the case, it prevents one from authoring a valid document which
will function in existing user agents while doing the following:
* naming a control
* uniquely identifying that same control for styling

Furthermore, in 4.10 of XHTML 1.0 it says (once again regarding 'id' and
'name' used as fragment identifiers):
"HTML 4 defined the name attribute for the elements a, applet, form, frame,
iframe, img, and map."

This omits at least one element, 'input', for which 'name' is also defined
in HTML 4.  Is this list supposed to be interpreted in the context of
fragment identification?  If so, the wording should be changed to make that
explicitly clear.  Otherwise, the list should be given correctly.

** PLEASE CC to my address -- I am not subscribed to the list **
Jesse McCarthy

mail2web - Check your email from the web at .

Received on Sunday, 24 November 2002 15:51:07 UTC