使用JavaScript设计web登陆界面 用户名 密码判断

 

<!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">
UserID and Password*/
function passuser(form) {
if (form.user.value=="weizhong") {   //判断用户名是否正确
if (form.password.value=="weizhong") {    //判断密码是否正确         
location="main.html"  //跳转页面
} else {
alert("Invalid Password")
}
} else {  alert("Invalid UserID")
}
}

function my_cancel(form)
{
 form.account.value="";
 form.password.value="";
}
</script>
</head>

<body>
<!--设计登陆界面
<center>
<table bgcolor="white" cellpadding="12" border="1">
<tr><td colspan="2"><center><h1><i><b>Login
Area</b></i></h1></center></td></tr>
<tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
name="user" type="text"></td></tr>
<tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="password"
type="password"></td></tr>
<tr><td><center><input type="button" value="Login"
onClick="passuser(login)"></center></td>
<td><center><br><input type="button" value="reset"
onClick="my_cancel(login)"></form></td>
</tr></table></center>
</body>

  • 4
    点赞
  • 21
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值