bootstrapValidator中用ajax校验

2020/04/30 10:15
阅读数 190
xlh : {
                validators : {
                    trigger : 'change',
                    notEmpty : {
                        message : '序列号不能为空'
                    },
                    threshold : 15,// 有2字符以上才发送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"// UserServlet判断调用方法关键字。
                            };
                        }
                    }
                }
            }
展开阅读全文
加载中
点击引领话题📣 发布并加入讨论🔥
0 评论
0 收藏
0
分享
返回顶部
顶部