js简单实现用户注册信息的校验代码

复制代码 代码如下:


<!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>
<style type="text/css">
  @import "css/userRegister.css";
</style>
</head>
<body>
<div>
<form method="post" action="url" >
 <table>
    <tbody>
        <tr>
           <td>用户名:</td>
           <td>
              <input  type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td>密码:</td>
           <td>
             <input type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td>确认密码:</td>
           <td>
             <input type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td>身份证号:</td>
           <td>
             <input type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td>电话号码:</td>
           <td>
             <input type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td>Email:</td>
           <td>
               <input type="text" onfocus="showDesc(this)" onblur="checkText(this)"/>
           </td>
        </tr>
        <tr>
           <td> </td>
           <td>
             <input type="submit" value="确认提交" />
           </td>
        </tr>
    </tbody> 
    </table>
   <table>
       <tr><td><span>请输入用户名</span></td></tr>
       <tr><td><span>请输入密码</span></td></tr>
       <tr><td><span>请再次输入密码</span></td></tr>
       <tr><td><span>请输入身份证号码</span></td></tr>
       <tr><td><span>请输入电话号码</span></td></tr>
       <tr><td><span>请输入邮箱地址</span></td></tr>
    </table>
</form>
</div>
<script  type="text/javascript"  src="https://www.jb51.net/jslib/registerCheck.js">
</script>
</body>
</html>

registerCheck.js

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wdwpgf.html