Home >Web Front-end >JS Tutorial >How to view form validation error information in JQuery_jquery

How to view form validation error information in JQuery_jquery

WBOY
WBOYOriginal
2016-05-16 17:20:461264browse

There is an error in form validation in JQuery. You can use the following method to view the error information of the specific input

Copy the code The code is as follows:

If(!$('form').valid())
{
$($('form').validate().errorList).each(function (index, item) {
Console.log($($(item).attr('element)).attr('name') ' ' $($(item).attr('element)).attr('message') );
});
}
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn