I am trying to change input value of a checkbox when it is checked/unchecked. It seems the value is changed (I debugged it via alert()) but is not reflected in the html. That's quite troublesome as I want to pull the value from the html and save it in a database.
$(document).ready(function(){
$("#box:checked").live('click', function(e) {
$("#box").val('1');
});
$("#box:not(:checked)").live('click', function(e) {
$("#box").val('0');
});
});
...
<input id="box" type="checkbox" value="">
...
I've been trying to solve this for hours. I came upon a guy who had the same problem, but the workaround was rather clumsy.
thanks for help