JQuery中form验证出错信息的查看方法
发布时间:2016-12-30 来源:查字典编辑
摘要:JQuery中form验证出错,可以采用以下方式来查看具体input的出错信息复制代码代码如下:If(!$(‘form').valid())...
JQuery中form验证出错,可以采用以下方式来查看具体input的出错信息
复制代码 代码如下:
If(!$(‘form').valid())
{
$($(‘form').validate().errorList).each(function (index, item) {
Console.log($($(item).attr(‘element)).attr(‘name') + ‘ ' + $($(item).attr(‘element)).attr(‘message'));
});
}