Why do you repeat the error messages with JQuery validation plugin validate?

0 like 0 dislike
6 views
Constantly repeated error messages connected to the engine, Jquery validator, the validation works, but displays all errors one after the other, already that only did not try to change, please see below the form code, script code, photo attached.

$(document).ready(function () {if ($("form[name=register]").length > 0) {$('input[id="bo_mgr_user_phone"]').addClass("{required: true, messages: { required: 'Phone: this field is required'}}")}});

$(document).ready(function () {// Code for form validation$("form[name=register]").validate({rules: {s_name: {required: true},s_email: {required: true,email: true},s_password: {required: true,minlength: 5},s_password2: {required: true,minlength: 5,equalTo: "#s_password"}},messages: {s_name: {required: "Название: это поле обязательно для заполнения."},s_email: {required: "E-mail: это поле обязательно для заполнения.",email: "Неверный адрес электронной почты."},s_password: {required: "Пароль: это поле обязательно для заполнения.",minlength: "Пароль: введите не менее 5 символов."},s_password2: {required: "Повторите пароль: это поле обязательно для заполнения.",minlength: "Повторите пароль: введите не менее 5 символов.",equalTo: "Пароли не совпадают."}},errorLabelContainer: "#error_list",wrapper: "div",invalidHandler: function (form, validator) {$('html,body').animate({scrollTop: $('h1').offset().top}, {duration: 250, easing: 'swing'});},submitHandler: function (form) {$('button[type=submit], input[type=submit]').attr('disabled', 'disabled');form.submit();}});});

5ae3594274fbf918091659.png
by | 6 views

1 Answer

0 like 0 dislike
It is necessary to check the element or not
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
asked May 4, 2019 by adelinvest
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
33,865 users