[thelist] NS6 radio buttons bug

James Aylard evolt at equilon-mrc.com
Tue Mar 27 18:25:16 CST 2001


Scott,

> James, do you have the code the article is using to create their 'bug?'
> --That dern msnbc article don't (that I could find in scan-reading the
> article)

http://www.bugnet.com/lab/ns6radiobutton.html

> cause depending on the method(s) used to retreive the value, there's a
part
> of me that thinks the above makes perfect sense (there's the array of
> values, and then then there's the selectedIndex value) and it may not be a
> bug after all. Or am I whacked and/or offbase?

    I think you might be thinking about the array you get from a *submitted*
value when multiple elements have the same name (such as with checkboxes
given the same name, or a multiple select list). The collection of radio
elements includes *all* of the radio elements, not just the checked ones, so
iterating through it isn't going to tell you much about which one was
checked first and which one last. And the selectedIndex thing only applies
to a select. So, yeah, you're whacked. :)

> The JS engine is supposed to be ECMA compliant, do ya know if this
behavior
> is against it?

    Without going to the effort to skim through the ECMAScript
documentation, I would say that this has to be buggy behavior -- a matter of
the "checked" value being updated out of sync with the onclick event. It's
been fixed in Mozilla 0.8.1, so it would appear the Mozilla team thought so,
too (see http://bugzilla.mozilla.org/show_bug.cgi?id=57239 for the juicy
details). A textbook example of why releasing Netscape 6 before Mozilla
reached "RTM" status was a bad idea...

James Aylard





More information about the thelist mailing list