js 验证问题 怎么没弹出?

来源:百度知道 编辑:UC知道 时间:2024/06/06 08:37:50
<Script Language="JavaScript" type="text/javaScript">
function check()
{
if (document.form1.xh.value=="")
{
alert("请 填写学号!");
document.form1.xh.focus();
return false;
}
if (document.form1.xh.value.indexOf("B05")=-1)
{
alert("xue hao shu ru bu zheng que!")
document.form1.xh.focus();
return false;
}
//xue hao jian yan

if (document.form1.xm.value=="")
{
alert("请填写xingmimg!");
return false;
}
//xing ming jian yan

if (document.form1.email.value.indexOf("@")==-1 || document.form1.email.value=="")
{
alert("qing xie shang zheng que de e_mail.");
return false;
}
// e_mail jian yan

password = document.form1.dlmm.value;
if (password == ""

错太多了.

<form id=form1>
学号: <input type=text name=xh value="" id=xh>
<input type=button value=检验学号 onclick=check();>
</form>
<Script language="javaScript">
function check()
{
var check1;
check1=form1.xh.value;
if(check1=="")
{
alert("请 填写学号!");
}
else

if (check=-1)
{
alert("xue hao shu ru bu zheng que!")
}
}
</script>
<hr>
<form id=form2>
姓名:<input type=text id=xm value=''>
<input type=button value=检验姓名 onclick=checkname();>
</form>
<Script language="javaScript">
function checkname()
{
var check2;
check2=form2.xm.value;
if(check2=="")
{
alert("请填写xingming!");
}
}
</script>
<hr>
<form id=form3>