Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery 1.4 change event bug in IE

I have this simple select:

<select name="zlecenia_index_icpp" id="items_per_page">  
    <option value="10">10</option>  
    <option value="25" selected="selected">25</option>  
    <option value="50">50</option>  
</select>

and on it there's:

$('#items_per_page').change(function(){  
    var controller_action = this.name.replace(/_/g, '/');  
    location.href = config.base_url + '/' + controller_action + '/'+this.value;  
});

It used to work in jQuery 1.3, but in 1.4 the change event is fired as soon as I click on the select box. Is there any solution besides going back to 1.3?


This really seems to be a bug and it has been reported to jQuery:

http://dev.jquery.com/ticket/5869

There has been a patch applied and will be part of jQuery 1.4.1.

http://github.com/jquery/jquery/commit/435772e29b4ac4ccfdefbc4045d43f714e153381

like image 339
pambuk Avatar asked Jan 19 '10 11:01

pambuk


1 Answers

Here's fix for this bug: http://github.com/mcurry/jquery/commit/a293f5938eb9efd41158b948f487672d43b7c820

Hopefully it'll get into 1.4.1

like image 150
Matt Curry Avatar answered Nov 02 '22 08:11

Matt Curry