I have a form with some input and select boxes, each has class=\"myClass\"
. I also have the following script:
$(document).ready(function() {
The only one that worked for me was unbind before the change check.
$(".select2Component").unbind();
$(".select2Component").change(function() {
//code
});
It happens when the same class or whatever attribute you are binding also has the same name parent or child. Obviously, when you change a child, parent also gets changed (its child changes). If they have the same class or attribute, it should fire twice. For example, in the following if you bind to "myClass", it will be called twice.
<div class="myclass">
<select class="myClass"> </select>
</div>
Its a bug, You'd add
$("#some_id").unbind('change');
before any change call