I have simple checkboxes in a table. This is the checkbox tag as I see it in code:
<input type="checkbox" id="iFact123" onchange="submit_status_change(123,$(this).prop('checked'));" >
Now for example in Firefox, this works fine. In Chrome, following happens:
- when checkbox clicked, the checkbox does not appear to change to checked/unchecked. it stays the same. at least visually
- the
submit_status_change()
runs ok and if I reload the page, the element is loaded as checked (which is now info from database). since this function takes info from$(this).attr('checked'))
, the element must be checked at least at the time the parameter is send - it just doesn't appear to.
Now anyone has any idea, or experience with such a problem?
If you think it has anything to do with the submit function, here it is:
function submit_status_change(id, val){
//$.post('something.php',{'change_status':id, 'status':val}, function(){});
}
UPDATE: attr
changed to prop
Chrome now changes the checkbox, at least visually. The onchange
event doesn't seem to happen.
Firefox:
TypeError: $(...).prop is not a function
[Break On This Error]
submit_tech_status(123,$(this).prop('checked'));
UPDATE2: I cut off some code. Now the submit function is pretty much clear. Firefox has an error with prop
, chrome prints no error, but doesn't run the submit function. Which is different from before, where the checkbox in chrome appeared not to get checked or unchecked, but the function went ok.