当前位置:Gxlcms > JavaScript > JQuery中form验证出错信息的查看方法

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

时间:2021-07-01 10:21:17 帮助过:2人阅读

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

人气教程排行