2016-03-20 53 views
2

我有一个脚本来防止表单,除非这三个值中的至少一个不等于0.该检查有效,但当我将值更改为不等于0时,提交按钮仍处于禁用状态,表格不会提交。任何帮助表示赞赏。JQUERY表单不提交

$("input[type='submit']").click(function(e){ 
// Stop the form submitting 
    e.preventDefault(); 

    if($("input[name='satscore']").val() != '0' || $("input[name='actscore']").val() != '0' || $("input[name='gpascore']").val() != '0'){ 
return true; 
    }else{ 
// Tell the user the input is invalid 
alert('Please select an option'); 
} 
}) 
+0

你需要解释什么是你的**输入型**,也许你可以展示你的HTML代码。 – Jevuska

回答

0

把e.preventDefault();在if语句中。

0

您阻止了点击。

更换

return true; 

随着

$("input[type='submit']").submit();