checkbox未选中不提交数据

如果checkbox为选中的话提交的数据为NULL

function checkForm()  
{    
alert(($("#checkbox").get(0).checked));

        if(!($("#checkbox").get(0).checked))  
         {  
             $("#checkbox").get(0).checked = true;  
             $("#checkbox").get(0).value = "0";  
          }
       $("#form").submit();
}  

  

原文地址:https://www.cnblogs.com/feifeishi/p/6556462.html