J. J. Cale wrote:
[snip]
using the name attribute or index into the forms array seems to me
the safest way to reference the form.
The forms collection. The object isn't actually an array (in an
ECMAScript sense).
IIRC the name att is a must in compliant browsers and is supported
in all UA's.
Only in that it is the most used method. The preferred approach is to
use the id attribute; the name attribute has been relegated to a state
of backwards compatibility. In theory, this means a future version of
HTML can deprecate the name attribute. In fact, this has happened in
XHTML 1.0 - the name attribute isn't defined in the Strict DTD.
FORM elements should be "labeled" using the id attribute. If
compatibility with ancient browsers like NN4 is desired, add the name
attribute as well. This also applies to images.
Whatever approach you take, it is still preferable to use the forms
(or images) collections as these are well supported and will accept
both name and id attribute values.
Mike
Be aware that this discussion does not extend to form controls (INPUT,
etc).
--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.