JQuery中form验证出错信息的查看方法


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'));
});
}

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3