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

  • 相关阅读:
    navigator
    历史记录跳转
    更改URL
    计数器
    窗口位置和大小
    open用法
    confirm用法
    项目中访问本地node服务跨域问题
    jenkins使用
    基于Vue的SSR
  • 原文地址:https://www.cnblogs.com/zhxhdean/p/2133922.html
Copyright © 2011-2022 走看看