表单提交时判断
<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();
}
}