登录验证帮助文档

来源:互联网 发布:淘宝运营专才 试题 编辑:程序博客网 时间:2024/03/29 23:41


需求效果这样子的



登录验证用到的框架validform

页面首先引入js


<script type="text/javascript" src="<%=DataConfig.DOM_URL %>/resources/js/validform/Validform_v5.3.2.js"></script>
        <script type="text/javascript" src="<%=DataConfig.DOM_URL %>/resources/js/validform/fold.js"></script>

原理就是每次输入一行之后发送一次ajax去判断

html代码


<dl>
          <dd>
          <input type="text" placeHolder="用户名" class="inputxt w220" name="customerName"  datatype="*6-20"  ajaxurl="<%=DataConfig.DOM_URL%>/zhibo/zhiboUser_checkUserNameExit.action"  nullmsg="请输入用户名" errormsg="用户名为6-16位任意字符" id="nameRegistInput" />
          <div class="Validform_checktip"></div>
          </dd>
          <dd>
          <input type="password" placeHolder="密码" id="passRegistInput" name="userpassword" datatype="n6-16" nullmsg="请设置密码!" errormsg="密码为6~16位数字!" class="inputxt w220" />
<div class="Validform_checktip"></div>         
          </dd>
          <dd>
          <input type="password" placeHolder="密码" datatype="*" recheck="userpassword" nullmsg="请再输入一次密码!" errormsg="您两次输入的账号密码不一致!" class="inputxt w220" />
          <div class="Validform_checktip"></div>
          </dd>
          <dd>
    <input type="text" placeholder="请输入您的手机号码" class="inputxt w220" name="mobile" id="mobile" ajaxurl="<%=DataConfig.DOM_URL%>/zhibo/zhiboUser_checkMobileExit.action"  
    datatype="tel" nullmsg="请输入您的手机号码" errormsg="手机号码格式不对" />
    <div class="Validform_checktip"></div>
    </dd>
    <dd>
    <input type="text" placeholder="验证码" class="inputxt w220"
    ajaxurl="<%=DataConfig.DOM_URL%>/zhibo/zhiboUser_chckedMobileCode.action" datatype="code" nullmsg="请输入手机验证码" errormsg="验证码只能为6位数字" />
    <div class="Validform_checktip"></div>
    <input type="button" class="code" value="获取验证码"  disabled/>
    </dd>
          <dd><input type="button" value="立即注册" class="loginBtn lb-1" id="registBtn" /></dd>
          </dl>


当然接下来就是要写大量action了


另外 这样子做仍然不行 这就要调fold.js这个文件了


0 0
原创粉丝点击