Bug Tracker

Opened 12 years ago

Closed 12 years ago

#9433 closed bug (invalid)

IE8 radio buttons can't be selected when jquery onchange event handler is assigned

Reported by: Raivo F Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.6.1
Keywords: Cc:
Blocked by: Blocking:


Probably it happens because jquery adds additional jQueryNNNNN.. attribute to input tags.

HTML source:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

<html xmlns="http://www.w3.org/1999/xhtml">
  <script type="text/javascript" src="jquery-1.6.1.min.js"></script>


  <form id="form1" action="" method="post">
    <label><input type="radio" name="test" value="1"/> Test 1</label>
    <label><input type="radio" name="test" value="2"/> Test 2</label>
    Value: <span id="val">?</span>

  <script type="text/javascript">


      $('#val').html($('#form1 input:radio:checked').val());
      return false;



Change History (2)

comment:1 Changed 12 years ago by Timmy Willison

Component: unfiledevent
Priority: undecidedlow

This works fine. There's no need for the return false: http://jsfiddle.net/timmywil/q3Jqu/.

I'm not sure what return false should/could do across browsers for a change event.

comment:2 Changed 12 years ago by dmethvin

Resolution: invalid
Status: newclosed

The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This event is valid for INPUT, SELECT, and TEXTAREA. element. Bubbles: Yes Cancelable: No Context Info: None -- http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-htmlevents

So yeah, don't return false or event.preventDefault() on a change event.

Note: See TracTickets for help on using tickets.