W3C home > Mailing lists > Public > w3c-wai-ig@w3.org > July to September 2002

RE: Accessible forms in XHTML

From: Jon Hanna <jon@spin.ie>
Date: Wed, 17 Jul 2002 11:38:38 +0100
To: <w3c-wai-ig@w3.org>

> but there IS a reason for the difference in values for the id and
> name attributes? Is there a reason why they can't be the same?

Not as far as I know in situations where you have one form.

If you have two or more forms which both contain an input with the same name
then you must have different id attributes because id attributes must be
unique within a document.

It's worth noting that the name attribute on an <input> element is quite
different to the name attribute on an <a> element - which is part of the
reason for the name attribute on <a> being deprecated in the first place (it
was deprecated back in HTML4.0 BTW).

On an <a> element name played the same purpose that the id attribute now
plays on all elements in identifying a fragment of the document. It
therefore makes sense to have the same value for the name and id attributes
so that the same fragment identifier will be matched to that element in
current browsers (using the id attribute) and older browsers than only
support name.

Since name doesn't do this on <input> elements there is no need to match the
values, but no big reason not to either, though it can be useful to have
different conventions for each).
Received on Wednesday, 17 July 2002 06:38:20 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 20:36:10 UTC