当前位置:首页 >> 网络编程

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

编辑:jimmy
  日期: 2024/10/10 浏览:1 次
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'));
});
}
上一篇: Firefox和IE兼容性问题及解决方法总结
下一篇: jquery $(this).attr $(this).val方法使用介绍