<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>用户注册!</title>
<style>
ul {list-style-type:none;}
ul li {margin-bottom:15px;}
.front_input {width:150px;display:block;text-align:right;}
.front_input,ul li input {float:left;}
.after_input {margin-left:5px;color:#FF0000;font-size:14px;folat:left;}
ul input {width:200px;height:18px;}
.front_input {clear:both;}
网页html下载 </style>
<script type="text/javascript">
//保存一个密码用于校验
var _pass;
/**
*检查用户名
*/
String.prototype.Trim = function() {
place(/(^\s*)|(\s*$)/g, ""); }
//---------------------------------------------------------------------------
function check_username(){
var username;
username = ElementById('username').value;
username = username.Trim();
if (username == "") {
ElementById('username_error').innerHTML = "请输入用户名";
} else {
if (/^\w{6,20}$/.test(username)) {
ElementById('username_error').innerHTML = "";
} else {
ElementById('username_error').innerHTML = "请输入6 ~ 20 字符【0-9】【a-z-A-Z】";
}
}
}
/**
*检查密码
*/
//---------------------------------------------------------------------------
function check_pass(){
var pass;
pass = ElementById('pass').value;
pass = pass.Trim();
_pass = pass;
if (pass == "") {
ElementById('pass_error').innerHTML = "请输入密码";
} else {
if (/^\w{6,20}$/.test(pass)) {
ElementById('pass_error').innerHTML = "";
} else {
ElementById('pass_error').innerHTML = "请输入6 ~ 20 字符【0-9】【a-z-A-Z】";
}
}
}
/**
*检查Email
*/
//---------------------------------------------------------------------------
function check_email(){
var email;
email = ElementById('email').value;
email = email.Trim();
if (email == "") {
ElementById('email_error').innerHTML = "请输入Email";
} else {
if (/^[\w-]+[\.]*[\w-]+[@][\w\-]{1,}([.]([\w\-]{1,})){1,3}$/.test(email)) {
ElementById('email_error').innerHTML = "";
} else {
ElementById('email_error').innerHTML = "请输入有效的Email地址";
}
}
}
/**
*检查rpass
*/
//---------------------------------------------------------------------------
function check_rpass(){
var rpass;
rpass = ElementById('rpass').value;
rpass = rpass.Trim();
if (rpass == "") {
ElementById('rpass_error').innerHTML = "请输入确认密码";
}
else if (rpass != _pass) {
ElementById('rpass_error').innerHTML = "密码不一致";
}
else {
ElementById('rpass_error').innerHTML = ""
}
}
//检查手机号:
function mobile(){
var mobile;
mobile = ElementById('mobile').value;
mobile = mobile.Trim();
if(mobile.length==0)
{
ElementById('iphone_error').innerHTML = "请输入手机号码!";
}
if(mobile.length!=11)
{
ElementById('iphone_error').innerHTML = "请输入11位的手机号码!";
// alert('请输入有效的手机号码!');
//bile.focus();
// return false;
}
else {
ElementById('iphone_error').innerHTML = ""
}
}
//---------------------------------------------------------------------------
function regist(){
var username_ElementById('username_error').innerHTML;
var pass_ElementById('pass_error').innerHTML;
var rpass_ElementById('rpass_error').innerHTML;
var email_ElementById('email_error').innerHTML; var iphone_ElementById('iphone_error').innerHTML;
var ElementById('username').value;
var ElementById('pass').value;
var ElementById('rpass').value;
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论