mirror of
https://github.com/jquery-validation/jquery-validation.git
synced 2025-12-20 09:11:40 +01:00
Improve error handling when no element is missing its name attribute. Still need to set debug flag to see exception.
This commit is contained in:
7
jquery.validate.js
vendored
7
jquery.validate.js
vendored
@@ -471,8 +471,11 @@ $.extend($.validator, {
|
||||
.not(":submit, :reset, :image, [disabled]")
|
||||
.not( this.settings.ignore )
|
||||
.filter(function() {
|
||||
if ( !this.name && validator.settings.debug && window.console ) {
|
||||
console.error( "%o has no name assigned", this);
|
||||
if ( !this.name ) {
|
||||
if ( window.console ) {
|
||||
console.error( "%o has no name assigned", this );
|
||||
}
|
||||
throw new Error( "Failed to validate, found an element with no name assigned. See console for element reference." );
|
||||
}
|
||||
|
||||
// select only the first element for each name, and only those with rules specified
|
||||
|
||||
Reference in New Issue
Block a user