61,112
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script language="javascript">
function check(){
if(document.form1.username.value==""){
alert("请输入登陆账号!")
return false;
document.form1.username.focus();
return false;}
else if(document.form1.password.value==""){
alert("请输入密码!");
return false;
document.form1.password.focus();
return false;
}
}
</script>
</head>
<body>
<form action="2.html" method="post" name="form1" onsubmit="check()">
<table cellpadding="0" cellspacing="0" border="2" width="450" height="100" align="center">
<tr>
<td align="right">用户名:</td>
<td><input type="text" name="username" /></td>
</tr>
<tr>
<td align="right">密码:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td align="right"><input type="submit" name="sub" value="确认" /></td>
<td align="center"><input type="button" name="button" value="注册" onclick="
window.location='reg.html'" /></td>
</tr>
</table>
</form>
</body>
</html>