New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in not validating array's of inputs correctly. #2326
Comments
JqueryValidation filtering same name elements under rules cache, I just comment the rulesCache. It works for me. |
How to add remote method validation to array of inputs using class name
` Have tried to use the following jquery validation rule function but getting error Uncaught TypeError: e.nodeName is undefined. Exception occurred when checking element ApplyConfirmpnSCTCDT1, check the 'remote' method. . The following are the jquery code. $(".scdDataDT").each(function() { |
This issue/proposal has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automatically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and one of the maintainers will (try!) to follow up. |
Subject of the issue
The error occurs in the instance of validating a form with array's of equal inputs, it only validates the first element found within the form.
Your environment
jquery-validate
: 1.19.1jquery
: 3.4.1Steps to reproduce
http://jsfiddle.net/thejoker_dev/p6zs51v8/
Expected behaviour
It should validate all types of inputs, including those that are arrays of themselves.
Actual behaviour
Validates only the first input of the array with the same name, leaving the rest unvalidated.
Attached jquery-validate.js file modified on line 465 (checkForm function) which I leave below and it works without problems!
checkForm: function() { this.prepareForm(); for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) { var checkingElements = this.findByName( elements[i].name ).not(this.settings.ignore); if (checkingElements.length !== undefined && checkingElements.length > 1) { for (var cnt = 0; cnt < checkingElements.length; cnt++) { this.check( checkingElements[cnt] ); } } else { this.check( elements[i] ); } } return this.valid(); }
Attached jquery-validate.js file modified on line 465 (checkForm function) which I leave below and it works without problems!
jquery.validate.zip
The text was updated successfully, but these errors were encountered: