zoukankan      html  css  js  c++  java
  • easyui表单数据验证

       <form id="ff" method="post">
    <div>
    <label for="name">
    Name:
    </label>
    <input class="easyui-validatebox" type="text" name="name" required="true" validtype="length[5,12]"></input>
    </div>
    <div>
    <label for="email">
    Email:
    </label>
    <input class="easyui-validatebox" type="text" name="email" required="true" validtype="email" invalidMessage="邮箱格式错误"></input>
    </div>
    <div>
    <label for="subject">
    Subject:
    </label>
    <input class="easyui-validatebox" type="text" name="subject" required="true" missingMessage="不能为空"></input>
    </div>
    <div>
    <label for="message">
    Message:
    </label>
    <textarea name="message" style="height: 60px;"></textarea>
    </div>
    <div>
    <input type="submit" value="Submit">
    </div>
    </form>

     

    Validate Rule

    The validate rule is defined by using required and validType property, here are the rules already implemented:

    • email: Match email regex rule.
    • url: Match URL regex rule.
    • length[0,100]: Between x and x characters allowed.
    • remote['http://.../action.do','paramName']: Send ajax request to do validate value, return 'true' when successfully.

       Properties

    NameTypeDescriptionDefault
    required boolean Defines if the field should be inputed. false
    validType string Defines the field valid type, such as email, url, etc. null
    missingMessage string Tooltip text that appears when the text box is empty. This field is required.
    invalidMessage string Tooltip text that appears when the content of text box is invalid. null

    http://www.jeasyui.com/documentation/validatebox.php

  • 相关阅读:
    并发编程(一) 操作系统基础和进程
    操作系统发展史
    网络编程(三) 大文件传输与UDP通信
    网络编程(二)-socket套接字
    网络编程(一)
    排序算法之冒泡法
    第二章 算法基础 思考题2-1
    查找算法之二分查找
    排序算法之归并排序
    排序算法之插入排序
  • 原文地址:https://www.cnblogs.com/zhxhdean/p/2133922.html
Copyright © 2011-2022 走看看