<input type="submit" id="myBtn" />
换成:
<input type="button" id="myBtn" />
用
$("#myBtn").click(function(){
...//判断验证
});
表单提交js:
function formSubmit(){
if(flag=="1"){
$("#form").submit();
}else if(flag=="2"){
$("#form").attr("action","deployResult.jsp");
$("#form").attr("target","_blank");
$("#form").attr("method","GET");
$("#form").attr("enctype","application/x-www-form-urlencoded");
$("#form").attr("encoding","application/x-www-form-urlencoded");
$("#form").submit();
}
}
原文:http://www.cnblogs.com/mabelstyle/p/3784503.html