jquery - Chrome checkbox not changing -
i have simple checkboxes in table. checkbox tag see in code:
<input type="checkbox" id="ifact123" onchange="submit_status_change(123,$(this).prop('checked'));" >
now example in firefox, works fine. in chrome, following happens:
- when checkbox clicked, checkbox not appear change checked/unchecked. stays same. @ least visually
- the
submit_status_change()
runs ok , if reload page, element loaded checked (which info database). since function takes info$(this).attr('checked'))
, element must checked @ least @ time parameter send - doesn't appear to.
now has idea, or experience such problem?
if think has submit function, here is:
function submit_status_change(id, val){ //$.post('something.php',{'change_status':id, 'status':val}, function(){}); }
update: attr
changed prop
chrome changes checkbox, @ least visually. onchange
event doesn't seem happen.
firefox:
typeerror: $(...).prop not function [break on error] submit_tech_status(123,$(this).prop('checked'));
update2: cut off code. submit function pretty clear. firefox has error prop
, chrome prints no error, doesn't run submit function. different before, checkbox in chrome appeared not checked or unchecked, function went ok.
just write like:
$("#ifact123").change( function() { var c = $(this).prop("checked"); // whatever want c value });
Comments
Post a Comment