If you find the need to have radio buttons and checkboxes sharing the same name (which can come in handy to group them into one structure during processing), you might be disappointed to find that IE 7 & 8 treat the checkbox as part of the radio button group. That is, if you select an radio button, it will toggle the checkbox.

I find this odd, because you can certainly have multiple checkboxes with the same name. It appears that adding a radio button in the mix causes issues.

I highly doubt this was their intention, as it appears to be resolved in IE 9.

You may be able to finagle a clever hack with JavaScript, but why add complexity. It might make sense to just change that checkbox to a yes/no radio button.

If you wish to demo this issue, try the following code:

<input type="radio" name="example" value="test1" />
<input type="radio" name="example" value="test2" />
<input type="checkbox" name="example" value="test3" />


Leave a Reply

Your email address will not be published. Required fields are marked *