注册页面表单验证
来源:互联网 发布:ug软件安装教程 编辑:程序博客网 时间:2024/05/16 07:37
这里只写一个实例。
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>留言板注册</title>
<script type="text/javascript">
function check(){
var username = document.form1.username.value;
var password = document.form1.password.value;
var password2 = document.form1.password2.value;
if(username==""||password=="")
{
alert("用户名密码不能为空!");
return false;
}else if(password.length<6){
alert("密码不能少于6位!");
return false;
}
else if(password!=password2){
alert("两次密码输入不一致!");
return false;
}
}
</script>
</head>
<body>
<center>
<img src="<%=request.getContextPath() %>/jsp/images/logo.png" alt="balabala"/>
<h3>留言板</h3>
</br>
</center>
<center>
<h2>用户注册</h2>
<form action="../user/register.do" method="post" name="form1" onsubmit="return check(this)">
用户名 :
<input onkeyup="value=value.replace(/[\W]/g,'') "
onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\d]/g,''))" type="text" name="username" maxlength=10 style="width: 150"><font color=red>*</font></br>
密 码:<input type="password" name="password" maxlength=10 style="width: 150"><font color=red>*</font></br>
确认密码:<input type="password" name="password2" maxlength=10 style="width: 150"><font color=red>*</font></br></br>
<input type="submit" value="注册"> <input type="reset" value="取消"></br></br>
<a href="../user/logout.do">欢迎登录</a>
</form><br>
<font color=red>${model.error}</font>
</center>
</body>
- 注册页面表单验证
- 各种常用注册页面表单验证
- 各种常用注册页面表单验证
- JQuery实现表单验证(注册页面)
- 一个注册会员页面中:表单验证的js
- php用户注册页面利用js进行表单验证
- 网站注册页面Demo及表单验证功能源码
- 仿京东的注册页面, 使用jQuery进行表单验证
- js注册表单验证
- ajax 注册表单验证
- 表单注册验证
- 【JavaWeb】验证注册表单
- 异步验证表单、注册
- 用户注册表单验证
- ThinkPHP--注册表单验证
- 验证注册表单
- 验证注册表单
- js表单注册验证
- 3D翻页
- 关于C++两个类相互引用的一点思考
- C#延时
- hdu5391 威尔逊定理
- 引用 和 指针
- 注册页面表单验证
- linux下常用mysql命令(1)
- ppt转换成pdf转换器的应用介绍
- 对象引用
- C++不定参数的应用
- Cpuinfo
- Log4j配置之按时间生成、按大小生成新文件
- Handler机制-从源码角度分析
- Java多线程之 Thread VS Runnable