登陆校验数据
来源:互联网 发布:mac如何运行java程序 编辑:程序博客网 时间:2024/05/16 06:37
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>校验数据</title>
<script>
function $(id){return document.getElementById(id);}
function checkLogin(){
var username=$("input1").value;
var pwd=$("input2").value;
if(username==""){
alert("用户名不能为空");
$("input1").focus();
return false;
}
else if(username.length<8||username.length>20){
alert("用户名的长度要在8到20个字符之间");
$("input1").focus();
return false;
}
else if(pwd==""){
alert("密码不能为空!");
$("input2").focus();
return false;
}
else {
if(pwd.length<8||pwd.length>20){
alert("密码的长度要在8到20个字符之间");
$("input2").focus();
return false;
}
}
}
</script>
<style type="text/css">
body{background:#336666;}
fieldset{
width:350px;
height:200px;
background:#336666;
margin:25px auto;
padding:20px;
color:white;
text-align:center;
}
legend{
font-size:30px;
color:white;
text-align:center;
}
</style>
</head>
<body>
<form name="form1" method="post" action="js401.php" />
<fieldset>
<legend>用户登录</legend>
用户名 <input type="text" id="input1" name="ip1"><br><br>
密 码 <input type="password" id="input2" name="ip2"><br><br><br>
<input type="submit" value="提交" onclick="checkLogin()"> <input type="reset" value="重置" />
</fieldset>
</form>
</body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>校验数据</title>
<script>
function $(id){return document.getElementById(id);}
function checkLogin(){
var username=$("input1").value;
var pwd=$("input2").value;
if(username==""){
alert("用户名不能为空");
$("input1").focus();
return false;
}
else if(username.length<8||username.length>20){
alert("用户名的长度要在8到20个字符之间");
$("input1").focus();
return false;
}
else if(pwd==""){
alert("密码不能为空!");
$("input2").focus();
return false;
}
else {
if(pwd.length<8||pwd.length>20){
alert("密码的长度要在8到20个字符之间");
$("input2").focus();
return false;
}
}
}
</script>
<style type="text/css">
body{background:#336666;}
fieldset{
width:350px;
height:200px;
background:#336666;
margin:25px auto;
padding:20px;
color:white;
text-align:center;
}
legend{
font-size:30px;
color:white;
text-align:center;
}
</style>
</head>
<body>
<form name="form1" method="post" action="js401.php" />
<fieldset>
<legend>用户登录</legend>
用户名 <input type="text" id="input1" name="ip1"><br><br>
密 码 <input type="password" id="input2" name="ip2"><br><br><br>
<input type="submit" value="提交" onclick="checkLogin()"> <input type="reset" value="重置" />
</fieldset>
</form>
</body>
</html>
1 0
- 登陆校验数据
- 登陆校验器
- 数据校验
- 数据校验
- 数据校验
- 数据校验
- 数据校验
- 实验_使用Struts框架进行数据验证(登陆校验)
- jsp+javabean+MySQL登陆校验[实例]
- SSH2+JQuery 简单的用户校验 登陆
- Java请求登陆校验的URL
- Servlet用户登陆过滤器,编码校验过滤器
- Jquery+Ajax+Mysql 前台校验注册登陆
- jsp登陆校验演示,servlet,login,success
- Django 用户系统 注册 校验 登陆
- TP5总结1:登陆校验的逻辑
- 页面数据校验
- Tapestry数据校验Validator
- 在JqGrid表格中自动生成按钮
- Android WindowManager 窗口泄漏的解决记录
- 项目经理成长三部曲
- 文章标题
- 素质拓展之1到30看图猜数并排序
- 登陆校验数据
- 稍加改动,手把手写一个acfun电影列表的爬虫-基于node
- BZOJ1878: [SDOI2009]HH的项链
- 51822静态配对密码
- 极客学院----H5的相关笔记----H5基础(6)
- 第一天
- [hihocoder1048]状态压缩2
- c语言
- RecyclerView系列之二:从源码中分析为RecyclerView添加分割线