Re: validating a form that uses javascript

by "Art Zoller Wagner" <art(at)zollerwagner.com>

 Date:  Mon, 3 Feb 2003 19:48:26 -0500
 To:  "Keith D Sellars" <Keith(at)webgraffix.com>,
<hwg-basics(at)mail.hwg.org>
 References:  S0026260871
  todo: View Thread, Original
Hi, Keith,

That's an interesting question. I'm surprised that "name=temps" doesn't
validate. I see that "name" is not in the HTML recommendations, but is in
DOM 1.

There are at least three different ways you can identify a form:
[window].document.FORMNAME
[window].document.forms[FORMNAME]
[window].document.forms[i]    where i is the index of the forms array.

Thus, if you want to avoid the name attribute, and if you have just one
form, I think you could use:
[window].document.forms[0]

Let us know if this validates. It should.

A good reference for this kind of question is Danny Goodman's Dynamic HTML
by O'Reilly.

Another book, Chuck Musciano  & Bill Kennedy's HTML & XHTML by O'Reilly,
says that "id" is the currently acceptable attribute and suggests the use of
id along with name to give broadest browser compatibility. So you might try
using "id" and see what happens. I'd use both name and id to be sure older
Netscape browsers could use the form, but then you wouldn't validate!

HTH, Art

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA