Simple, smart and pleasant validation solution.

Overview

nice-validator

Build Status Downloads Version License MIT

Simple, smart and pleasant validation solution.

Download the latest release or install package via npm or bower

$ npm install nice-validator
$ bower install nice-validator

Getting started

1. Include jQuery 1.7+

2. Include nice-validator

width <script> tag:

<script src="path/to/nice-validator/jquery.validator.min.js?local=en"></script>

via webpack

require('nice-validator')
require('nice-validator/local/zh-CN')

via module loader Requirejs:

requirejs.config({
    paths: {
        jquery: 'http://cdn.jsdelivr.net/jquery/1.12.3/jquery.min',
        validator: 'path/to/nice-validator/local/en'
    },
    shim: {
        validator: ['path/to/nice-validator/jquery.validator.js?css']
    }
});

require(['validator']);

3. Config rules

<form id="form1">
<input type="text" name="field1" data-rule="required;email;remote(checkEmail.php)">
<input type="text" name="field2" data-rule="required;length(6~16)">
<input type="text" name="field3" data-rule="match(field2)">
<input type="text" name="field4" data-rule="range(0~100)" id="field4">
<input type="text" name="field5" data-rule="required(#field4:filled)">
<input type="text" name="field6" data-rule="required; mobile|email;" data-msg="Please fill mobile or email">
<input type="text" name="field7"
    data-rule="required; !digits; length(6~)"
    data-msg-digits="Please not fill pure digits"
    data-msg-length="Please fill at least {1} characters.">
<input type="checkbox" name="field8" data-rule="checked">
... yadda yadda ...
</form>

It has started to work when you use native submitting.

4. Handle submit (Optional)

$("#form1").on('valid.form', function(){
    // You can do something, then submit form by native
    // this.submit();
    // or submit form by ajax
    $.post("path/to/server", $(this).serialize())
        .done(function(d){
            // do something
        });
});

Documention

Browser Support

  • IE6+
  • Chrome
  • Safari 4+
  • Firefox 9+
  • Opera

Bugs / Contributions

  • Report a bug
  • To contribute or send an idea, github message me or fork the project

Build

Install dependencies:

$ npm install -g gulp
$ npm install

Run test and build:

$ gulp

License

nice-validator is available under the terms of the MIT License.

Comments
  • remote BUG

    remote BUG

    唯一验证出现这种情况 ,当进入编辑页后,将值绑定到了文本框里面,直接点保存按钮,调用不到后台方法,必须先让文本框获得焦点,再失去焦点,触发它的验证, 然后再点保存按钮,才能触发后台事件。 .net qq20131024190645 qq20131024190703

    <form method="post" action="CA0101New.aspx?PageIndex=1" id="form1" enctype="multipart/form-data">
    <div class="aspNetHidden">
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUHMTQ1NDc2MA9kFgICAQ8WAh4HZW5jdHlwZQUTbXVsdGlwYXJ0L2Zvcm0tZGF0YRYQAhcPEA8WBh4NRGF0YVRleHRGaWVsZAUHR0EwMzAwMh4ORGF0YVZhbHVlRmllbGQFB0dBMDMwMDEeC18hRGF0YUJvdW5kZ2QQFQQJ6K+36YCJ5oupCem7kem+meaxnwblkInmnpcJ5YaF6JKZ5Y+kFQQABjEwMDAwMAYxMTAwMDAGMTQwMDAwFCsDBGdnZ2dkZAIZDxBkEBUBCeivt+mAieaLqRUBABQrAwFnZGQCHw8QDxYGHwEFB0NCMDEwMDIfAgUHQ0IwMTAwMR8DZ2QQFQUJ6K+36YCJ5oupC1N0YXRlIE93bmVkGEZ1bGx5IG93bmVkIGJ5IGZvcmVpZ25lcg1Kb2ludCBWZW50dXJlCkluZGl2aWR1YWwVBQABMQEyATMBNBQrAwVnZ2dnZ2RkAiMPEA8WBh8BBQdDQjAyMDAyHwIFB0NCMDIwMDEfA2dkEBUECeivt+mAieaLqQNPRU0IRW5kLVVzZXIIUmVzZWxsZXIVBAABMgEzATQUKwMEZ2dnZ2RkAiUPEA8WBh8BBQdDQjAzMDAyHwIFB0NCMDMwMDEfA2dkEBUHCeivt+mAieaLqRVIZWF2eSBJbmR1c3RyeeOAgUZvb2QcUGhhcm1hY2V1dGljYWzjgIFGYWJyaWNhdGlvbgdQcm9jZXNzC0NoYW5uZWwgT0VNDkluZHVzdHJpYWwgT0VNDU5VTExNYWNoaW5lcnkVBwABMQEyATMBNAE1ATYUKwMHZ2dnZ2dnZ2RkAicPEGQQFQEJ6K+36YCJ5oupFQEAFCsDAWdkZAIrDxAPFgYfAQUHR0EwNTAwMx8CBQdHQTA1MDAxHwNnZBAVBQnor7fpgInmi6kH55S15a2QQQfnlLXlrZBCB+eUteWtkEMH55S15a2QRBUFAAExATIBMwE0FCsDBWdnZ2dnZGQCLQ8QDxYGHwEFB0dBMDYwMDMfAgUHR0EwNjAwMR8DZ2QQFQUJ6K+36YCJ5oupB+axvei9pkEH5rG96L2mQgfmsb3ovaZDB+axvei9pkQVBQABMQEyATMBNBQrAwVnZ2dnZ2RkGAEFHl9fQ29udHJvbHNSZXF1aXJlUG9zdEJhY2tLZXlfXxYMBQ5yYnRuQ0EwMTAyNFllcwUOcmJ0bkNBMDEwMjRZZXMFDXJidG5DQTAxMDI0Tm8FDXJidG5DQTAxMDI0Tm8FDnJidG5DQTAxMDI1WWVzBQ5yYnRuQ0EwMTAyNVllcwUNcmJ0bkNBMDEwMjVObwUNcmJ0bkNBMDEwMjVObwUOcmJ0bkNBMDEwNDdZZXMFDnJidG5DQTAxMDQ3WWVzBQ1yYnRuQ0EwMTA0N05vBQ1yYnRuQ0EwMTA0N05vRgAgXQuzX88Q2qKGIax22Gp9nZl1tLLwTuxB/fUf3BY=" />
    </div>
    
        <div id="content-header">
            <h1>
                新增客户资料</h1>
        </div>
        <div id="breadcrumb">
            <a href="#" title="" class="tip-bottom" data-original-title="客户资料管理"><i class="icon-home">
            </i>客户资料管理 </a><a href="#" class="current">新增客户资料</a>
        </div>
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span12">
                    <div class="content-box">
                        <div class="content-h">
                            <div class="bh">
                                <i class="icon-plus-sign"></i><span>新增</span></div>
                        </div>
                        <ul class="nav nav-tabs">
                                <li class="active"><a href="#jiben" data-toggle="tab">基本信息</a></li>
                                <li><a href="#xiangxi" data-toggle="tab">详细信息</a></li>
                            </ul>
                        <div class="xz tab-content">
                        <div class="tab-pane active" id="jiben">
                            <div class="control-group">
                                <label>
                                    <span>客户编号/Customer Code:</span>
                                    <input type="hidden" name="Type" value="CA01New" />
                                    <input name="txtCA01002" type="text" id="txtCA01002" data-rule="Customer Code:required;length[1~20, true];remote[/Handler/UniquenessHandler.ashx, txtCA01002, Type ]" />
                                </label> 
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户名称/Customer Name:</span>
                                    <input name="txtCA01003" type="text" id="txtCA01003" data-rule="Customer Name:required;length[1~20, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户英文名/Customer Ename:</span>
                                    <input name="txtCA01004" type="text" id="txtCA01004" data-rule="Customer Ename:length[1~100, true];letters" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>开票地址电话/Billing Add/Tel:</span>
                                    <input name="txtCA01005" type="text" id="txtCA01005" data-rule="Billing Add/Tel:length[1~200, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>开户行/Bank Name:</span>
                                    <input name="txtCA01006" type="text" id="txtCA01006" data-rule="Bank Name:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>银行账户/Bank Account:</span>
                                    <input name="txtCA01007" type="text" id="txtCA01007" data-rule="Bank Account:digits" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>税号/Tax Registration No:</span>
                                    <input name="txtCA01008" type="text" id="txtCA01008" data-rule="Tax Registration No:digits" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>联系人/Contact person:</span>
                                    <input name="txtCA01009" type="text" id="txtCA01009" data-rule="Contact person:length[1~50, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>联系人电话/Tel:</span>
                                    <input name="txtCA01010" type="text" id="txtCA01010" data-rule="Tel:telOrMobil" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>联系人传真/Fax:</span>
                                    <input name="txtCA01011" type="text" id="txtCA01011" data-rule="Fax:length[1~15, true];fax" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>邮政编码/Post Code:</span>
                                    <input name="txtCA01012" type="text" id="txtCA01012" data-rule="Post Code:postcode" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>所属省份/Province:</span>
                                    <select name="ddlGA03Province" id="ddlGA03Province" onchange="GetCity(this.value)" data-rule="Province:required">
        <option value="">请选择</option>
        <option value="100000">黑龙江</option>
        <option value="110000">吉林</option>
        <option value="140000">内蒙古</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>所属城市/City:</span>
                                    <select name="ddlGA03City" id="ddlGA03City" data-rule="City:required">
        <option value="">请选择</option>
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>信用期限/Credit Days:</span>
                                    <input name="txtCA01014" type="text" id="txtCA01014" data-rule="Credit Days:length[1~50, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>信用额度/Credit Amount:</span>
                                    <input name="txtCA01015" type="text" id="txtCA01015" data-rule="Credit Amount:length[1~50, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户类型/Customer Type:</span>
                                    <select name="ddlCA01016" id="ddlCA01016" data-rule="Customer Type:required">
        <option value="">请选择</option>
        <option value="1">State Owned</option>
        <option value="2">Fully owned by foreigner</option>
        <option value="3">Joint Venture</option>
        <option value="4">Individual</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户等级/Grade:</span>
                                    <input name="txtCA01017" type="text" id="txtCA01017" data-rule="Grade:length[1~10, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户代码/CTC:</span>
                                    <select name="ddlCA01018" id="ddlCA01018" data-rule="CTC:required">
        <option value="">请选择</option>
        <option value="2">OEM</option>
        <option value="3">End-User</option>
        <option value="4">Reseller</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>行业分类/MDT:</span>
                                    <select name="ddlCA01019" id="ddlCA01019" data-rule="MDT:required">
        <option value="">请选择</option>
        <option value="1">Heavy Industry、Food</option>
        <option value="2">Pharmaceutical、Fabrication</option>
        <option value="3">Process</option>
        <option value="4">Channel OEM</option>
        <option value="5">Industrial OEM</option>
        <option value="6">NULLMachinery</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>行业代码/SIC:</span>
                                       <select name="ddlCA01020" id="ddlCA01020" data-rule="SIC:required">
        <option value="">请选择</option>
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>分类/Devision Code:</span>
                                    <input name="txtCA01021" type="text" id="txtCA01021" data-rule="Devision Code:required;length[1~10, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>240电子/240 Category:</span>
                                    <select name="ddlCA01022" id="ddlCA01022">
        <option value="">请选择</option>
        <option value="1">电子A</option>
        <option value="2">电子B</option>
        <option value="3">电子C</option>
        <option value="4">电子D</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>220汽车/220 Category:</span>
                                    <select name="ddlCA01023" id="ddlCA01023">
        <option value="">请选择</option>
        <option value="1">汽车A</option>
        <option value="2">汽车B</option>
        <option value="3">汽车C</option>
        <option value="4">汽车D</option>
    
    </select>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>脱琉/FGD(Y/N):</span>
                                    <label class="radio inline">
                                        <input id="rbtnCA01024Yes" type="radio" name="rbtnCA01024" value="rbtnCA01024Yes" />是
                                    </label>
                                    <label class="radio inline">
                                        <input id="rbtnCA01024No" type="radio" name="rbtnCA01024" value="rbtnCA01024No" />否
                                    </label>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>信用客户/Credit Customer(Y/N):</span>
                                    <label class="radio inline">
                                        <input id="rbtnCA01025Yes" type="radio" name="rbtnCA01025" value="rbtnCA01025Yes" />是
                                    </label>
                                    <label class="radio inline">
                                        <input id="rbtnCA01025No" type="radio" name="rbtnCA01025" value="rbtnCA01025No" />否
                                    </label>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>重点客户/key customer:</span>
                                    <label class="radio inline">
                                        <input id="rbtnCA01047Yes" type="radio" name="rbtnCA01047" value="rbtnCA01047Yes" />是
                                    </label>
                                    <label class="radio inline">
                                        <input id="rbtnCA01047No" type="radio" name="rbtnCA01047" value="rbtnCA01047No" />否
                                    </label>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>备注/Comment:</span>
                                    <textarea name="txtCA01026" rows="2" cols="20" id="txtCA01026" data-rule="Comment:length[1~500, true]">
    </textarea>
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>客户文件:</span>
                                    <input type="file" name="fudCustomerFile" id="fudCustomerFile" />
                                </label>
                            </div>
                        </div>
                        <div class="tab-pane" id="xiangxi">
                            <div class="control-group">
                                <label>
                                    <span>注册地址:</span>
                                    <input name="txtCA01027" type="text" id="txtCA01027" data-rule="注册地址:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>实际办公地址:</span>
                                    <input name="txtCA01028" type="text" id="txtCA01028" data-rule="实际办公地址:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>网址:</span>
                                    <input name="txtCA01029" type="text" id="txtCA01029" data-rule="网址:length[1~100, true];url" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>电子信箱:</span>
                                    <input name="txtCA01030" type="text" id="txtCA01030" data-rule="电子信箱:length[1~100, true];email" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>成立日期:</span>
                                    <input name="txtCA01031" type="text" id="txtCA01031" class="w215 rqxz_1" data-rule="成立日期:length[1~100, true];date" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>法定代表人:</span>
                                    <input name="txtCA01032" type="text" id="txtCA01032" data-rule="法定代表人e:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>注册资本:</span>
                                    <input name="txtCA01033" type="text" id="txtCA01033" data-rule="注册资本:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>登记机关:</span>
                                    <input name="txtCA01034" type="text" id="txtCA01034" data-rule="登记机关:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>注册号:</span>
                                    <input name="txtCA01035" type="text" id="txtCA01035" data-rule="注册号:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>经营范围:</span>
                                    <input name="txtCA01036" type="text" id="txtCA01036" data-rule="经营范围:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>经营期限:</span>
                                    <input name="txtCA01037" type="text" id="txtCA01037" data-rule="经营期限:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>企业类型:</span>
                                    <input name="txtCA01038" type="text" id="txtCA01038" data-rule="企业类型:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>所属行业:</span>
                                    <input name="txtCA01039" type="text" id="txtCA01039" data-rule="所属行业:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>上级主管单位或母公司情况:</span>
                                    <input name="txtCA01040" type="text" id="txtCA01040" data-rule="上级主管单位或母公司情况:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>股东背景:</span>
                                    <input name="txtCA01041" type="text" id="txtCA01041" data-rule="股东背景:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>厂区情况:</span>
                                    <input name="txtCA01042" type="text" id="txtCA01042" data-rule="厂区情况:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>仓库情况:</span>
                                    <input name="txtCA01043" type="text" id="txtCA01043" data-rule="仓库情况:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>办公环境:</span>
                                    <input name="txtCA01044" type="text" id="txtCA01044" data-rule="办公环境:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>员工素质:</span>
                                    <input name="txtCA01045" type="text" id="txtCA01045" data-rule="员工素质:length[1~100, true]" />
                                </label>
                            </div>
                            <div class="control-group">
                                <label>
                                    <span>财务状况:</span>
                                    <input name="txtCA01046" type="text" id="txtCA01046" data-rule="财务状况:length[1~100, true]" />
                                </label>
                            </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row-fluid">
                <div class="page-footer">
                    <input type="submit" name="btnSave" value="保 存" id="btnSave" class="btn btn-primary" />
                    &nbsp;
                    <input type="button" class="btn btn-primary" onclick="DataClear()" value="重 置" />
                    &nbsp;
                    <input type="submit" name="btnReturn" value="返 回" id="btnReturn" class="btn btn-primary" novalidate="" />
                </div>
            </div>
        </div>
        </form>     
    
    opened by chunln 16
  • FAQ:自定义远程验证(remote)返回的结果格式

    FAQ:自定义远程验证(remote)返回的结果格式

    $('#form').validator({
        dataFilter: function(data) {
            // 返回 niceValidator 支持的格式
            return data;
        },
        fields: {
            'username': '用户名: required; username; remote[check/username.php]'
        }
    });
    

    或者在字段中传递dataFilter,优先级更高

    $('#form').validator({
        fields: {
            'username': {
                rule: '用户名: required; username; remote[check/username.php]',
                dataFilter: function(data) {
                    // 返回 niceValidator 支持的格式
                    return data;
                }
            }
        }
    });
    

    假设后端返回的数据为:

    {"type":"error", "msg": "用户名已存在!"}
    

    如果后端不能更改返回数据格式,那么你需要在前端转换一下:

    $('#form').validator({
        dataFilter: function(data) {
            var d = {};
            data = $.parseJSON(data);
            d[ data.type ] = data.msg;
            return d;
        },
        fields: {
            'username': '用户名: required; username; remote[check/username.php]'
        }
    });
    
    question documentation 
    opened by niceue 10
  • 让光标定位到表单域会报错

    让光标定位到表单域会报错

    例如有个表单域是: >input type="password" name="password" data-rule="帐号密码:required;password" placeholder="帐号密码">

    加一段js: document.getElementsByName("password")[0].focus();

    直接报错: Uncaught TypeError: Cannot read property 'fields' of undefined

    去掉插件就没问题. 请问如何让光标定位到指定域?

    improve 
    opened by lileichinasoft 9
  • 使用dom绑定规则,然后使用js初始化的时候,theme设置无效

    使用dom绑定规则,然后使用js初始化的时候,theme设置无效

    使用dom绑定规则,然后使用js初始化的时候,设置theme为yellow_right无效,还是使用了default主题。

    1. 只使用dom绑定,不使用js初始化就可以
    2. 或者js初始化的时候另外设置formClass: 'n-yellow', msgClass: 'n-right', msgArrow: '' 也可以
    bug 
    opened by shangwq 5
  • 当input的type设置为number的时候,要对这个input进行是否为数值验证失效

    当input的type设置为number的时候,要对这个input进行是否为数值验证失效

    当前脚本的版本信息: /*! nice Validator 0.8.0

    • (c) 2012-2014 Jony Zhang [email protected], MIT Licensed
    • http://niceue.com/validator/ */

    问题描述: 当input的type设置为number的时候,要对这个input进行是否为数值验证失效,只能提示"不能为空",如果在这个input输入英文字符的时候,依然提示"不能为空"。将input的type改为text验证正常。 为了在移动设备上可以更方便的输入数字(弹出数字键盘),所以才会将input的type设为number。 测试html代码 `

    数量:

    `

    测试zh_CN.js配置 $.validator.config({ stopOnError: true, //focusCleanup: true, theme: 'yellow_top', msgStyle: "float:left;z-index:999", timely: 2, defaultMsg: "{0}格式不正确", loadingMsg: "正在验证...",

    顺便提到一个“msgStyle: "float:left;z-index:999",”这个配置,因为我是在bootstrap3.3.6中使用您这个验证插件,并且又用到了input-group这个效果,如果没有加上msgStyle这个配置,会导致验证提示位置不正常。

    improve 
    opened by lxcsmallcity 5
  • 选程验证

    选程验证

    远程验证后,返回提交正确的信息后,不刷新的情况下,再次输入相同的信息,失去焦点后就不会再发送远程验证了。比如,验证码,远程验证成功一次后,不刷新的情况下,输入或粘贴相同的验证码,还提示验证成功,并且不再发送远程验证,等待提交表单成功后,如果页面没刷新,同样输入相同的验证码,还是提示验证成功,这样的话,验证码就等同虚设了。可以用手动验证这个字段的方法来解决,不过总感觉不够优雅,不知是不是一个BUG。

    opened by zhaoqishan 5
  • 多次动态插入input 同一name input tips会出现问题

    多次动态插入input 同一name input tips会出现问题

    
    <input id="d_name_1" name="textfield" type="text" aria-required="true" class="" aria-invalid="false" data-inputstatus="ok" readonly="readonly">
    
    <input id="d_name_2" name="textfield" type="text" aria-required="true" class="n-invalid" aria-invalid="true" data-inputstatus="error">
    

    以上两个均为append插入至DOM的,不过后面的 _2 input可以进行校验,不过他在校验后,显示的结果显示在了 _1显示的位置

    尝试解决时发现:

    假如以 input的 id作为name 只有 id_1 的input ok,可以正常显示tips,id_2 处于没有反应的状态 ,将name_2 的那么 改为 name_1后 可以显示,但是显示在 id_1的input后面tips

    原先出现问题是插入的代码为 
    <input  data-rule="required;"  type="text" name="d_name" id="d_name_'+ d.sid+'" />
    经修改:
    <input  data-rule="required;"  type="text" name="d_name_'+ d.sid+'" id="d_name_'+ d.sid+'" />
    
    
    question 
    opened by jnadorg 5
  • 动态插入input会引起未知错误

    动态插入input会引起未知错误

    以下为堆栈日志

    <error>
    d_identifyCardNumber_2 39:377
    <input id=​"d_identifyCardNumber_2" class=​"checkidcard n-invalid" name=​"textfield2" data-rule=​"required;​idcard;​" type=​"text" aria-invalid=​"true" data-inputstatus=​"error">​
     39:365
    d_identifyCardNumber_2 39:377
    <input id=​"d_identifyCardNumber_2" class=​"checkidcard n-invalid" name=​"textfield2" data-rule=​"required;​idcard;​" type=​"text" aria-invalid=​"true" data-inputstatus=​"error">​
     39:365
    <error>
    <input id=​"d_identifyCardNumber_2" class=​"checkidcard" name=​"textfield2" data-rule=​"required;​idcard;​" type=​"text" aria-invalid=​"false" data-inputstatus=​"ok">​
     jquery.validator.js:5
    0: required -> true jquery.validator.js:5
    1: idcard -> true jquery.validator.js:5
    <input id=​"d_phoneNumber_2" name=​"textfield14" data-rule=​"required;​mtelc1;​" type=​"text" class=​"n-invalid" aria-invalid=​"true" data-inputstatus=​"error">​
     jquery.validator.js:5
    0: required -> 不能为空 jquery.validator.js:5
    2
    <error>
    jQuery.event.dispatch
    elemData.handle
    jQuery.event.trigger
    (anonymous function)
    jQuery.extend.each
    jQuery.fn.jQuery.each
    jQuery.fn.extend.trigger
    (anonymous function)
    jQuery.event.dispatch
    elemData.handle
    jQuery.event.trigger
    (anonymous function)
    jQuery.extend.each
    jQuery.fn.jQuery.each
    

    报错的部分使用的是DOM插入的

     '<div class="bd_table"> '+
     '  <table cellspacing="1" cellpadding="0" border="0" width="100%" class="tableInputst"> '+
     '    <tr> '+
     '      <td class="bd_td_e" width="200">姓名</td> '+
     '      <td><input id="d_name_'+ d.sid+'" name="textfield" type="text" data-rule="required;"/></td> '+
     '      <td class="bd_td_e" width="200">身份证号</td> '+
     '      <td><input id="d_identifyCardNumber_'+ d.sid+'" class="checkidcard" name="textfield2" data-rule="required;idcard;" type="text"/><input id="d_id_'+ d.sid+'" name="textfield14" type="hidden"/></td> '+
     '    </tr> '+
     '    <tr> '+
     '      <td class="bd_td_e">性别</td> '+
     '      <td><label for="bdselect"/> '+
     '      <input id="d_genderType_'+ d.sid+'" type="text"/> '+
     ' </td> '+
     '      <td class="bd_td_e" width="200">出生日期</td> '+
     ' <td><input value="" type="hidden" id="d_birthd >'
    

    代码片段,以上会append到某个地方并显示出来,造成页面卡顿,并提示堆栈溢出 以上 chrome 最新x64

    bug 
    opened by jnadorg 5
  • 与Bootstrap 3集成时,验证消息显示位置不正确

    与Bootstrap 3集成时,验证消息显示位置不正确

    在与Bootstrap 3.0.0 RC2集成时,验证信息显示位置如下图所示:

    image

    javascript:

    $(function() {
        $('#registerForm').validator({
            theme : 'simple_right',
            fields : {
                'email' : 'required;email;remote[check/email]',
                'username' : 'required;username;remote[check/username]',
                'password' : 'required;password'
            }
        });
    });
    

    html:

    <div class="container">
        <form id="registerForm" class="form-horizontal" action="" method="POST">
            <fieldset>
                <legend>注册</legend>
                <div class="form-group">
                    <label for="inputEmail" class="col-lg-2 control-label">电子邮箱</label>
                    <div class="col-lg-4">
                        <input name="email" type="text" class="form-control" id="inputEmail" placeholder="电子邮箱">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputUsername" class="col-lg-2 control-label">用户名</label>
                    <div class="col-lg-4">
                        <input name="username" type="text" class="form-control" id="inputUsername" placeholder="用户名">
                    </div>
                </div>
                <div class="form-group">
                    <label for="inputPassword" class="col-lg-2 control-label">密码</label>
                    <div class="col-lg-4">
                        <input name="password" type="password" class="form-control" id="inputPassword" placeholder="密码">
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-offset-2 col-lg-10">
                        <button type="submit" class="btn btn-primary">注册</button>
                    </div>
                </div>
            </fieldset>
        </form>
    </div>
    
    question 
    opened by shelltea 5
  • 结束时间大于开始时间

    结束时间大于开始时间

                          <input name="deadlineDate" type="text" readonly  class="form-control" data-rule="截止时间:required;date;match(gte, startDate, date)"   />
                        <input name="startDate" type="text" readonly  class="form-control"  data-rule="开始时间:required;date" />
    

    我的错误消息是 startDate必须大于截止时间,怎么把startDate换成开始时间

    opened by freegg 4
  • 远程验证缓存验证结果

    远程验证缓存验证结果

    自定义规则判断该值是否唯一:保存成功之后再修改该值时,仅当新值不等于旧值才发起AJAX请求验证。 若改变该值为一个已经存在的值时,验证功能正确。 然后再将值变回原值,这时仍使用上次验证结果,提示“已存在”。

    var preIp=$("#preKey").val(); var ip=$("#ip").val(); if(preIp!=ip){ return $.ajax({ url: '../resource/checkOnly.action', type: 'post', data: {ip:ip}, dataType: 'json' }); }

    除了去掉条件判断,每次都远程请求外,还有别的解决办法吗?

    question 
    opened by ShirleyLAN 4
  • Bump qs from 6.5.2 to 6.5.3

    Bump qs from 6.5.2 to 6.5.3

    Bumps qs from 6.5.2 to 6.5.3.

    Changelog

    Sourced from qs's changelog.

    6.5.3

    • [Fix] parse: ignore __proto__ keys (#428)
    • [Fix] utils.merge: avoid a crash with a null target and a truthy non-array source
    • [Fix] correctly parse nested arrays
    • [Fix] stringify: fix a crash with strictNullHandling and a custom filter/serializeDate (#279)
    • [Fix] utils: merge: fix crash when source is a truthy primitive & no options are provided
    • [Fix] when parseArrays is false, properly handle keys ending in []
    • [Fix] fix for an impossible situation: when the formatter is called with a non-string value
    • [Fix] utils.merge: avoid a crash with a null target and an array source
    • [Refactor] utils: reduce observable [[Get]]s
    • [Refactor] use cached Array.isArray
    • [Refactor] stringify: Avoid arr = arr.concat(...), push to the existing instance (#269)
    • [Refactor] parse: only need to reassign the var once
    • [Robustness] stringify: avoid relying on a global undefined (#427)
    • [readme] remove travis badge; add github actions/codecov badges; update URLs
    • [Docs] Clean up license text so it’s properly detected as BSD-3-Clause
    • [Docs] Clarify the need for "arrayLimit" option
    • [meta] fix README.md (#399)
    • [meta] add FUNDING.yml
    • [actions] backport actions from main
    • [Tests] always use String(x) over x.toString()
    • [Tests] remove nonexistent tape option
    • [Dev Deps] backport from main
    Commits
    • 298bfa5 v6.5.3
    • ed0f5dc [Fix] parse: ignore __proto__ keys (#428)
    • 691e739 [Robustness] stringify: avoid relying on a global undefined (#427)
    • 1072d57 [readme] remove travis badge; add github actions/codecov badges; update URLs
    • 12ac1c4 [meta] fix README.md (#399)
    • 0338716 [actions] backport actions from main
    • 5639c20 Clean up license text so it’s properly detected as BSD-3-Clause
    • 51b8a0b add FUNDING.yml
    • 45f6759 [Fix] fix for an impossible situation: when the formatter is called with a no...
    • f814a7f [Dev Deps] backport from main
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump decode-uri-component from 0.2.0 to 0.2.2

    Bump decode-uri-component from 0.2.0 to 0.2.2

    Bumps decode-uri-component from 0.2.0 to 0.2.2.

    Release notes

    Sourced from decode-uri-component's releases.

    v0.2.2

    • Prevent overwriting previously decoded tokens 980e0bf

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.1...v0.2.2

    v0.2.1

    • Switch to GitHub workflows 76abc93
    • Fix issue where decode throws - fixes #6 746ca5d
    • Update license (#1) 486d7e2
    • Tidelift tasks a650457
    • Meta tweaks 66e1c28

    https://github.com/SamVerschueren/decode-uri-component/compare/v0.2.0...v0.2.1

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimatch and gulp

    Bump minimatch and gulp

    Bumps minimatch to 3.1.2 and updates ancestor dependency gulp. These dependencies need to be updated together.

    Updates minimatch from 0.2.14 to 3.1.2

    Commits
    Maintainer changes

    This version was pushed to npm by isaacs, a new releaser for minimatch since your current version.


    Updates gulp from 3.9.1 to 4.0.2

    Release notes

    Sourced from gulp's releases.

    v4.0.2

    Fix

    Docs

    • Add notes about esm support (4091bd3) - Closes #2278
    • Fix the Negative Globs section & examples (3c66d95) - Closes #2297
    • Remove next tag from recipes (1693a11) - Closes #2277
    • Add default task wrappers to Watching Files examples to make runnable (d916276) - Closes #2322
    • Fix syntax error in lastRun API docs (ea52a92) - Closes #2315
    • Fix typo in Explaining Globs (5d81f42) - Closes #2326

    Build

    • Add node 12 to Travis & Azure (b4b5a68)

    v4.0.1

    Fix

    Docs

    • Fix error in ES2015 usage example (a4e8d48) - Closes #2099 #2100
    • Add temporary notice for 4.0.0 vs 3.9.1 documentation (126423a) - Closes #2121
    • Improve recipe for empty glob array (45830cf) - Closes #2122
    • Reword standard to default (b065a13)
    • Fix recipe typo (86acdea) - Closes #2156
    • Add front-matter to each file (d693e49) - Closes #2109
    • Rename "Getting Started" to "Quick Start" & update it (6a0fa00)
    • Add "Creating Tasks" documentation (21b6962)
    • Add "JavaScript and Gulpfiles" documentation (31adf07)
    • Add "Working with Files" documentation (50fafc6)
    • Add "Async Completion" documentation (ad8b568)
    • Add "Explaining Globs" documentation (f8cafa0)
    • Add "Using Plugins" documentation (233c3f9)
    • Add "Watching Files" documentation (f3f2d9f)
    • Add Table of Contents to "Getting Started" directory (a43caf2)
    • Improve & fix parts of Getting Started (84b0234)
    • Create and link-to a "docs missing" page for LINK_NEEDED references (2bd75d0)
    • Redirect users to new Getting Started guides (53e9727)
    • Temporarily reference gulp@next in Quick Start (2cecf1e)
    • Fixed a capitalization typo in a heading (3d051d8) - Closes #2242
    • Use h2 headers within Quick Start documentation (921312c) - Closes #2241
    • Fix for nested directories references (4c2b9a7)
    • Add some more cleanup for Docusaurus (6a8fd8f)
    • Temporarily point LINK_NEEDED references to documentation-missing.md (df7cdcb)
    • API documentation improvements based on feedback (0a68710)

    ... (truncated)

    Changelog

    Sourced from gulp's changelog.

    gulp changelog

    4.0.0

    Task system changes

    • replaced 3.x task system (orchestrator) with new task system (bach)
      • removed gulp.reset
      • removed 3 argument syntax for gulp.task
      • gulp.task should only be used when you will call the task with the CLI
      • added gulp.series and gulp.parallel methods for composing tasks. Everything must use these now.
      • added single argument syntax for gulp.task which allows a named function to be used as the name of the task and task function.
      • added gulp.tree method for retrieving the task tree. Pass { deep: true } for an archy compatible node list.
      • added gulp.registry for setting custom registries.

    CLI changes

    • split CLI out into a module if you want to save bandwidth/disk space. you can install the gulp CLI using either npm install gulp -g or npm install gulp-cli -g, where gulp-cli is the smaller one (no module code included)
    • add --tasks-json flag to CLI to dump the whole tree out for other tools to consume
    • added --verify flag to check the dependencies in package.json against the plugin blacklist.

    vinyl/vinyl-fs changes

    • added gulp.symlink which functions exactly like gulp.dest, but symlinks instead.
    • added dirMode param to gulp.dest and gulp.symlink which allows better control over the mode of the destination folder that is created.
    • globs passed to gulp.src will be evaluated in order, which means this is possible gulp.src(['*.js', '!b*.js', 'bad.js']) (exclude every JS file that starts with a b except bad.js)
    • performance for gulp.src has improved massively
      • gulp.src(['**/*', '!b.js']) will no longer eat CPU since negations happen during walking now
    • added since option to gulp.src which lets you only match files that have been modified since a certain date (for incremental builds)
    • fixed gulp.src not following symlinks
    • added overwrite option to gulp.dest which allows you to enable or disable overwriting of existing files
    Commits
    • 069350a Release: 4.0.2
    • b4b5a68 Build: Add node 12 to Travis & Azure
    • 5667666 Fix: Bind src/dest/symlink to the gulp instance to support esm exports (ref s...
    • 4091bd3 Docs: Add notes about esm support (closes #2278)
    • 3c66d95 Docs: Fix the Negative Globs section & examples (closes #2297)
    • 1693a11 Docs: Remove next tag from recipes (closes #2277)
    • d916276 Docs: Add default task wrappers to Watching Files examples to make runnable (...
    • ea52a92 Docs: Fix syntax error in lastRun API docs (closes #2315)
    • 5d81f42 Docs: Fix typo in Explaining Globs (#2326)
    • ea3bba4 Release: 4.0.1
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump minimist from 1.2.5 to 1.2.6

    Bump minimist from 1.2.5 to 1.2.6

    Bumps minimist from 1.2.5 to 1.2.6.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump path-parse from 1.0.6 to 1.0.7

    Bump path-parse from 1.0.6 to 1.0.7

    Bumps path-parse from 1.0.6 to 1.0.7.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Failed to set a named property on 'HTMLFormElement': Named property setter is not supported.

    Failed to set a named property on 'HTMLFormElement': Named property setter is not supported.

    版本

    nice Validator 0.7.3

    错误提示

    jquery.validator.js:5. Uncaught TypeError: Failed to set a named property on 'HTMLFormElement': Named property setter is not supported.

    报错行

    s.$el[0].isValid=a?s.isFormValid():a

    背景

    之前的老代码,使用一直很正常,今天偶然发现 Validator 报错,最近未改动什么代码。

    • 同样的代码,Edge 浏览器下正常,Google下会报错
    • 同样的代码,生产环境运行正常,本地却会报错
    提示信息
    • 表单中存在一个【id="isValid" name="isValid"】元素,将其注释掉后不再报错。
    • 最新版的 v1.1.5 也存在这个问题。报错行:me.isValid = me.$el[0].isValid = isValid ? me.isFormValid() : isValid;

    看起来像属性名冲突了,但是正如我上面提到情况,之前一直都正常,没动过代码。

    测试的临时处理方案

    s.$el[0].isValid=a?s.isFormValid():a 我把这段代码捕获了一下(try-catch),发生异常后不做任何处理(没去设置 me.$el[0].isValid 这个属性),页面各项校验执行起来似乎也正常。 但不知道到这个问题怎么回事。

    opened by thegoldenyou 0
Releases(1.1.5)
FieldVal - multipurpose validation library. Supports both sync and async validation.

FieldVal-JS The FieldVal-JS library allows you to easily validate data and provide readable and structured error reports. Documentation and Examples D

null 137 Sep 24, 2022
Dead simple Object schema validation

Yup Yup is a JavaScript schema builder for value parsing and validation. Define a schema, transform a value to match, validate the shape of an existin

Jason Quense 19.2k Jan 2, 2023
A simple credit cards validation library in JavaScript

creditcard.js A simple credit cards validation library in JavaScript. Project website: https://contaazul.github.io/creditcard.js Install creditcard.js

ContaAzul 323 Jan 7, 2023
Schema-Inspector is an JSON API sanitisation and validation module.

Schema-Inspector is a powerful tool to sanitize and validate JS objects. It's designed to work both client-side and server-side and to be scalable wit

null 494 Oct 3, 2022
:white_check_mark: Easy property validation for JavaScript, Node and Express.

property-validator ✅ Easy property validation for JavaScript, Node and Express Built on top of validator.js, property-validator makes validating reque

Netto Farah 160 Dec 14, 2022
Lightweight and powerfull library for declarative form validation

Formurai is a lightweight and powerfull library for declarative form validation Features Setup Usage Options Methods Rules Examples Roadmap Features ?

Illia 49 May 13, 2022
Facile is an HTML form validator that is inspired by Laravel's validation style and is designed for simplicity of use.

Facile is an HTML form validator that is inspired by Laravel's validation style and is designed for simplicity of use.

upjs 314 Dec 26, 2022
TypeScript-first schema validation for h3 and Nuxt applications

h3-zod Validate h3 and Nuxt 3 requests using zod schema's. Install npm install h3-zod Usage import { createServer } from 'http' import { createApp } f

Robert Soriano 48 Dec 28, 2022
Themis is a validation and processing library that helps you always make sure your data is correct.

Dataffy Themis - The advanced validation library Themis is a validation and processing library that helps you always make sure your data is correct. ·

Dataffy 14 Oct 27, 2022
jQuery Validation Plugin library sources

jQuery Validation Plugin - Form validation made easy The jQuery Validation Plugin provides drop-in validation for your existing forms, while making al

null 10.3k Jan 3, 2023
String validation

validator.js A library of string validators and sanitizers. Strings only This library validates and sanitizes strings only. If you're not sure if your

null 20.7k Jan 5, 2023
Lightweight JavaScript form validation library inspired by CodeIgniter.

validate.js validate.js is a lightweight JavaScript form validation library inspired by CodeIgniter. Features Validate form fields from over a dozen r

Rick Harrison 2.6k Dec 15, 2022
Cross Browser HTML5 Form Validation.

Validatr Cross Browser HTML5 Form Validation. Getting Started View the documentation to learn how to use Validatr. Changelog Version 0.5.1 - 2013-03-1

Jay Morrow 279 Nov 1, 2022
jQuery Validation Plugin library sources

jQuery Validation Plugin - Form validation made easy The jQuery Validation Plugin provides drop-in validation for your existing forms, while making al

null 10.3k Jan 3, 2023
jQuery form validation plugin

jQuery.validationEngine v3.1.0 Looking for official contributors This project has now been going on for more than 7 years, right now I only maintain t

Cedric Dugas 2.6k Dec 23, 2022
The most powerful data validation library for JS

joi The most powerful schema description language and data validator for JavaScript. Installation npm install joi Visit the joi.dev Developer Portal f

Sideway Inc. 19.6k Jan 4, 2023
v8n ☑️ ultimate JavaScript validation library

The ultimate JavaScript validation library you've ever needed. Dead simple fluent API. Customizable. Reusable. Installation - Documentation - API Intr

Bruno C. Couto 4.1k Dec 30, 2022
A lightweight NodeJS library for strict mime-type validation on streams

A lightweight NodeJS library for strict mime-type validation on streams. It gets a ReadableStream and decets the mime-type using its Magic number and validates it using the provided allowed and forbidden lists; If it's allowed it will pass it to the created WritableStreams and if it's not it will throw an error.

CEO of Death Star 9 Apr 3, 2022
📫 Offline email validation - JS or TS

email-seems-valid An offline check to see if an email seems valid. Contains TS or JS packages for browser or Node.js emailSeemsValid('[email protected]')

earnifi 12 Dec 25, 2022