Ever tried to use the onChange event to catch a change of state in a radio button group? The following code works alright in Firefox, but not in Internet Explorer:
<input type="radio" name="options" id="option1" onChange="alert('option1')">
<input type="radio" name="options" id="option2" onChange="alert('option2')">
IE treats the onChange event in a different manner: it recognizes something changed just after you lose focus on that element. The solution for this problem is to use the onClick javascript event instead of onChange.
<input type="radio" name="options" id="option1" onClick="alert('option1')">
<input type="radio" name="options" id="option2" onClick="alert('option2')">
RSS feed for comments on this post · TrackBack URI
Leave a reply