Gestire i checkbox
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<form>
<input id="chk_id" type="checkbox" name="" checked>
<input id="txt_id" type="text" name="myName" value="1"><!-- type="hidden" -->
</form>
<script>
function fnct_chk(box_id, val_id)
{
if(document.getElementById(box_id).checked == true)
{
document.getElementById(val_id).value = 1;
}
else
{
document.getElementById(val_id).value = 0;
}
}
document.getElementById("chk_id").addEventListener("click", function(){fnct_chk("chk_id", "txt_id");})
</script>
</body>
</html>