W3C home > Mailing lists > Public > www-html@w3.org > February 2002

HTMLdocument.getElementsByName() behaviour grey area

From: Rowland Shaw <Rowland.Shaw@crystaldecisions.com>
Date: Mon, 4 Feb 2002 03:19:34 -0800
Message-ID: <963A03BCAFF059488BAFF33AE5C8709707FFCF@IPSENT04>
To: "'www-dom@w3.org'" <www-dom@w3.org>, "'www-html@w3.org'" <www-html@w3.org>
I was wondering if I can get something clarified regarding
getElementsByName()

I'm working with a piece of dynamically generated HTML content that
represents a cellgrid (so, in reality, it's a <table> with a header row and
column).

An iteration over all the data cells is required.

Historically, we've been using the famously hideous document.all collection;
with a well known id on each cell. (so you end up with multiple cells with
the same id, which is illegal, of course)

In an effort to move the code to work on non-IE browsers, we're looking to
move to W3 compliant code, but we're stuck in a little vicious circle:
* Gecko based browsers don't use the id attribute for gEBN(), and only
answer to the name attribute (even if it's not formally defined for an
element).
* IE based browsers use the id attribute for gEBN() and the name attribute
for elements that have a name attribute formally defined for them. (e.g.
input elements, and not <td> or <div>)

The dirty hack of a solution is to emit and id _and_ and name with the same
value (which is, of course, invalid mark-up)


What I'd like clarified is whether gEBN() should be looking at id attributes
or not

I'm also interested in whether name attributes that aren't formally defined
should be ignored (a la IE) or whether Gecko's interpretation (which, IMHO,
I prefer) of looking at name attributes that aren't formally defined could
be considered 'correct'.


--
Rowland

Today's random quote:
I saw a woman wearing a sweatshirt with 'Guess' on it. I said, 'Thyroid
problem?' - Emo Philips
Received on Monday, 4 February 2002 06:20:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:15:50 GMT