|
<html>
<head>
<title>登录页面</title>
<script language="javascript"type="text/javascript">
function CheckSubmit()
{
if(document.form.username.value=="")
{alert("请输入用户名。");document.form.username.focus();return false; }
else
{ if(-1!=document.form.username.value.indexOf(' '))
{alert("用户名不能包含空格。");return false;}
}
if(document.form.password.value=="")
{alert("请输入密码。");document.form.password.focus();return false;}
else
{ if(-1!=document.form.password.value.indexOf(' '))
{alert("用户名不能包含空格。");return false;}
}
alert("登陆成功!");
return true;
}
</script>
<body>
</script>
</head>
<body>
<form name=form>
<table width="300"align="center">
<tr>
<th colspan="2">网站登录</th>
</tr>
<tr>
<td width="80" align="right">用户名:</td>
<td><input type="text" name="username" onpropertychange="javascript:if(this.value.length>=8)this.form.password.focus();"><br></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input type=password name="password"/></td>
</tr>
<tr>
<td> </td>
<td><input type=submit name=submit onclick="return CheckSubmit();"value="登录">
<input name="btnReset" type="button" id="btnReset" onclick="this.form.reset()"value="重置"/></td>
</tr>
</table>
</form>
</body>
</html> |
|