[thelist] NS6 radio buttons bug

James Aylard evolt at equilon-mrc.com
Tue Mar 27 17:34:31 CST 2001


Scott,

> Don't recall seeing this yet .  ..
> http://www.msnbc.com/news/550220.asp?0nm=N17O
> For what it's worth, this report isn't quite accurate.

    The first paragraph is a bit hard to stomach, too:

"We can understand when JavaScript incompatibilities surface in Microsoft's
Internet Explorer. Microsoft always seems to take a standard technology and
tweak it just enough for the Windows platform to make it unusable on any
other platform. That's why it came as such a surprise when BugNet discovered
that Netscape 6 is having problems with standard JavaScript radio buttons.
When Netscape, the creator of JavaScript, released version 6 of it's
favorite browser, we all assumed JavaScript would be supported without
giving it another thought. Time to revisit that assumption."

    Even if one overlooks the gratuitous dig at Internet Explorer (which is
not deserved in this respect, IMO), the shock -- shock! -- that Netscape 6
might have a scripting bug is more than a bit laughable. (And what are
"JavaScript radio buttons", anyway?)

> That's annoying.  A work around would be, if there is a list of values in
> Form.radiobutton, take the last one.

    A bit of testing that I did found that Netscape 6 actually *submits* the
correct value on form submission, but testing for the value using an onclick
would report both the current value and the previous value.
    However, if you need to test for the current value using the onclick
event, simply taking the last value in the radio button collection (or
array) won't work: the script will return the two values in the order in
which they appear in the collection, rather than the order in which they
were clicked. So, if you click 1 and then 2, you will get 1 then 2; but if
you click 2 and then 1, you will still get 1 then 2.
    To get around this, you should simply grab the value of the radio button
that was just clicked. At least, this is what my quick tests show.

James Aylard





More information about the thelist mailing list