主题:谁给我看看这是怎么回事啊??
如果我没输入值的话,单击下一步,程序也不报错,怎么回事啊,这段JAVASCRIPT怎么没作用呢
<script language="javascript">
function check1(){
if (document.form1.accout.value==""){
alert("帐号不能空");
document.form1.accout.focus();
return false;
}
if (document.form1.phone.value==""){
alert("电话不能空");
document.form1.phone.focus();
return false;
}
if (document.form1.esn.value==""){
alert("ESN/IP不能空");
document.form1.esn.focus();
return false;
}
if (document.form1.imsi.value==""){
alert("imsi不能空");
document.form1.imsi.focus();
return false;
}
if (document.form1.sid.value==""{
alert("SID不能空“);
document.form1.sid.focus();
return false;
}
if (document.form1.nid.value==""){
alert("NID不能空");
document.from1.nid.focus();
return false;
}
return true;
}
</script>
<form action="updata1.jsp" method="post" name="form1">
<h3>填写用户基本信息</h3>
<br>
<br>
账 号:<input type="text" name="accout" value=""> 电话:<input type="text" name="phone" value="">
<br>
<br>
ESN/IP:<input type="text" name="esn" value=""> IMSI:<input type="text" name="imsi" value="">
<br />
<br>
SID :<input type="text" name="sid" value=""> NID : <input type="text" name="nid" value="">
<br>
<br>
<input type="submit" name="submit" value="下一步" onClick="return check1()"> <input type="reset" name="reset1" value="重写">
</form>
<script language="javascript">
function check1(){
if (document.form1.accout.value==""){
alert("帐号不能空");
document.form1.accout.focus();
return false;
}
if (document.form1.phone.value==""){
alert("电话不能空");
document.form1.phone.focus();
return false;
}
if (document.form1.esn.value==""){
alert("ESN/IP不能空");
document.form1.esn.focus();
return false;
}
if (document.form1.imsi.value==""){
alert("imsi不能空");
document.form1.imsi.focus();
return false;
}
if (document.form1.sid.value==""{
alert("SID不能空“);
document.form1.sid.focus();
return false;
}
if (document.form1.nid.value==""){
alert("NID不能空");
document.from1.nid.focus();
return false;
}
return true;
}
</script>
<form action="updata1.jsp" method="post" name="form1">
<h3>填写用户基本信息</h3>
<br>
<br>
账 号:<input type="text" name="accout" value=""> 电话:<input type="text" name="phone" value="">
<br>
<br>
ESN/IP:<input type="text" name="esn" value=""> IMSI:<input type="text" name="imsi" value="">
<br />
<br>
SID :<input type="text" name="sid" value=""> NID : <input type="text" name="nid" value="">
<br>
<br>
<input type="submit" name="submit" value="下一步" onClick="return check1()"> <input type="reset" name="reset1" value="重写">
</form>