I have a problem with the following code in an ASPX page:
Solved: this to work with Firefox 3.6.12 and IE8.
$(function(){
$("form input:checkbox").unbind("click")
.click(function(){
val = $(this).val();
alert(val);
})
}
The trick is to unbind("click").
before bind it to .click(fn)
; this will disabled the same event to fire twice.
Note that event "change" will not tricker at first time checkbox has been checked. So I use "click" instead.