[thelist] NS6 radio buttons bug

Edwin Martin e.j.martin at chello.nl
Thu Mar 29 05:35:18 CST 2001


Scott wrote:

>Don't recall seeing this yet .  ..
>
>http://www.msnbc.com/news/550220.asp?0nm=N17O

Hmm, looks like it's some kind of general browser bug.
IE also has some radio/checkbox quirks. Try this:

<form>
<input type="checkbox" name="val" onClick="alert(this.value)"> Value 1
</form>

<form>
<input type="radio" name="val" value="Value 1" 
onChange="alert(this.value)"> Value 1<br>
<input type="radio" name="val" value="Value 2" 
onChange="alert(this.value)"> Value 2<br>
<input type="radio" name="val" value="Value 3" 
onChange="alert(this.value)"> Value 3
</form>

The checkbox always returns 'on' and the radio buttons react even
stranger.

According to HTML 4 (http://www.w3.org/TR/html4/interact/scripts.html):

onclick "may be used with most elements".

onchange "applies to the following elements: INPUT, SELECT, and TEXTAREA"

Although you might argue whether it's a bug, I think it is.

Edwin Martin.

--
Surf Edwin Martin's brainwaves: http://www.bitstorm.org/edwin/ 





More information about the thelist mailing list