[thelist] Finding all checkboxes or radios w same name, without document.all

Christian Heilmann lists at onlinetools.org
Tue Feb 8 03:39:18 CST 2005


Dave Merrill wrote:

>Nice resource Christian, didn't know about that (though I did know about
>other pages at quirksmode).
>
>So the upshot seems to be that support for getElementsByName is funky in
>some respects on most major browsers. But still, it may be ok for typical
>use. For instance, if I wanted to get the effective submit value of a set of
>radios, then...
>  a) They'll all be form objects, which are supported. (The quirksmode pages
>says IEwin only sees 'input' objects, but here it also sees selects and
>textareas.)
>  b) There won't be other objects on the page with IDs that overlap the
>names of the form elements I'm using. At least, I can't think of any reason
>why there'd need to be.
>  c) They'll all be standard html objects, not custom tags like the reported
><ppk>. Again, I can't think of any reason why I'd need custom tags in this
>context.
>
>One thing this does tell me is that Safari, which I don't have, has at least
>this level of support, at least by v1.2.
>
>Any other ideas on what to do for platforms where it actually fails?
>  
>
I'd loop through the form elements and check their name attribute 
comparing it to the name you want.

Another option is cssQuery: http://dean.edwards.name/my/cssQuery.js.html





More information about the thelist mailing list