bootstrapValidator remote 的接受 验证 值

本来之前也做过一次这样的验,但可能是这两天太热脑袋不够用了,于是就只有看看源码咯

that.updateStatus(updateAll ? $f.attr('data-bv-field') : $f, response.valid ? that.STATUS_VALID : that.STATUS_INVALID, v);

写到这儿才想去原来是例子的,只是是PHP上次也是看例子才知道了

返回的对象必须是: {"valid",true}或 {"valid",false}

记录下来,别次别忘了,天气热,大脑有种在宕机的感觉!

, remote: {
type: 'get',
url: '。。。',
dataType: "json", //接受数据格式
data: {
HiddenClsCode: function () {
return $("#ClsCode").attr("value");
},
MatCode: function() {
return $("#MatCode").attr("value");
},
},
message: '编号已存在!',
delay: 2000
}

posted @ 2016-08-25 18:23  三瑞  阅读(1427)  评论(0编辑  收藏  举报