javascript登陆问题,结果 java不劳动,直接点 登陆 就上去了
帮看看
<form method="post" name="frmlogin" action="verifyid.asp"
onsubmit="javascript:return validatelogin();">
<table align="center" bgcolot="#cccccc" border="0"
cellpadding="0" cellspacing="0" width="273">
<tr>
<td align="right" height="47" valign="bottom" width="94">用户名:
</td>
<td height="47" valign="bottom" width="172">
<input name="txtusername" size="15" maxlength="15">
</td>
</tr>
<tr>
<td align="right" width="94">密码:
</td>
<td width="172">
<input name="txtpassword" type="password" value size="15" maxlength="15">
</td>
</tr>
<tr>
<td align="right" height="44" width="94">
</td>
<td height="44" width="172">
<input name="submit" type="submit" value="提交">
<input name="reset" type="reset" value="重置">
</td>
</tr>
</table>
</form>
<script language="javascript">
<!--
function validatelogin()
{var strusername=document.frmlogin.txtusername.value;
var strpassword=document.frmlogin.txtpassword.value;
var primeinusername=document.frmlogin.txtusername.value.indexof("'");
var priminpassword=document.frmlogin.txtpassword.value.indexof("'");
if(strusername=="")
{alert("输入用户名");
return false;
}
if(strpassword=="")
{alert("输入密码");
return false;
}
if(primeinusername!=-1)
{alert("密码中不能有撇号!");
return false;
}
if(primeinpassword!=-1)
{alert("用户名中不能包含撇号!")
return false;
}
}
//-->
</script>