js 表单验证
function one() { var group = document.getElementById("group").value; if(group == ""){alert("分组不能为空"); return false;} var ss = document.getElementById("ss").value; if(ss == ""){alert("城市不能为空"); return false;} var sss = document.getElementById("sss").value; if(sss == ""){alert("县区不能为空"); return false;} } function two(){ var name = document.getElementById("name").value; if(name == ""){alert("名字不能为空"); return false;} var psw = document.getElementById("psw").value; if(psw == ""){alert("密码不能为空"); return false;} var number = document.getElementById("number").value; if(number == ""){alert("手机号不能为空"); return false;} var groups = document.getElementById("groups").value; if(groups == ""){alert("分组不能为空"); return false;} var gss = document.getElementById("gss").value; if(gss == ""){alert("城市不能为空"); return false;} var gsss = document.getElementById("gsss").value; if(gsss == ""){alert("县区不能为空"); return false;} } function three(){ var upname = document.getElementById("upname").value; if(upname == ""){alert("名字不能为空"); return false;} var uppsw = document.getElementById("uppsw").value; if(uppsw == ""){alert("密码不能为空"); return false;} var upnumber = document.getElementById("upnumber").value; if(upnumber == ""){alert("手机号不能为空"); return false;} var upgroup = document.getElementById("upgroup").value; if(upgroup == ""){alert("分组不能为空"); return false;} var upss = document.getElementById("upss").value; if(upss == ""){alert("城市不能为空"); return false;} var upsss = document.getElementById("upsss").value; if(upsss == ""){alert("县区不能为空"); return false;} }
<form action="pup.php" method="post" onsubmit="return three()">
以此类推
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。