[thelist] Finding all checkboxes or radios w same name, withoutdocument.all
Peter Brunone (EasyListBox.com)
peter at easylistbox.com
Mon Feb 7 22:40:43 CST 2005
This may have been suggested already (my apologies if it has),
but what about
document.formName.elementName
?
You get a collection/array that you can run through with an
index; is that bad practice these days?
Regards,
Peter
-----Original Message-----
From: thelist-bounces at lists.evolt.org On Behalf Of Dave Merrill
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?
Dave Merrill
> Joe Ngo wrote:
>
> >Use DOM method getElementsByName(). This is a W3C standard and I
> >believe supported by most modern browsers.
> >
> >
> >
> believing is not knowing: http://www.quirksmode.org/dom/w3c_core.html
--
* * Please support the community that supports you. * *
http://evolt.org/help_support_evolt/
For unsubscribe and other options, including the Tip Harvester
and archives of thelist go to: http://lists.evolt.org
Workers of the Web, evolt !
More information about the thelist
mailing list