form表单点击后验证

function check(){

var customertype = document.getElementById("customertype");
//alert(customertype.value);
if(customertype.value == 0){
alert("没有输入客户关系度!");
customertype.focus();
return false;
}
return true;
}

 <form method="post" action="__URL__" onsubmit="return check()">

</form>

原文地址:https://www.cnblogs.com/liuwenbohhh/p/4754512.html