bootstrapValidator中用ajax校验


xlh : {
                validators : {
                    trigger : 'change',
                    notEmpty : {
                        message : '序列号不能为空'
                    },
                    threshold : 15,// 有15字符以上才发送ajax请求
                    remote : {// ajax验证。server result:{"valid",true or false}
                        url : appPath + "/app/chanpin/check/",
                        message : '该条形码已经存在',
                        delay : 500,// ajax刷新的时间是1秒一次
                        type : 'POST',
                        // 自定义提交数据,默认值提交当前input value
                        data : function(validator) {
                            return {
                                userName : $("input[name=userName]").val(),
                                method : "checkUserName"// 判断调用方法关键字。
                            };
                        }
                    }
                }
            }


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM