[jQuery] [validate] ignore: using '.multiple, .selectors'
For others wanting to utilize multiple selectors in their ignore
parameter ala:
$validator = $('form.validate').validate({
ignore: '.ignore, .ignore :input, :hidden :input'
});
Just one item must be changed in v1.5 to allow this, which will only
add to the functionality and not detract anything.
Line#421 Before: .not( this.settings.ignore )
Line#421 ---After: .not( $(this.settings.ignore) )
This:
// select all valid inputs inside the form (no submit or reset
buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114
is solved
return $([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :image, [disabled]")
.not( this.settings.ignore )
.filter(function() {
!this.name && validator.settings.debug && window.console &&
console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with
rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules
()) )
return false;
rulesCache[this.name] = true;
return true;
});
Becomes This:
// select all valid inputs inside the form (no submit or reset
buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114
is solved
return $([]).add(this.currentForm.elements)
.filter(":input")
.not(":submit, :reset, :image, [disabled]")
.not( $(this.settings.ignore) )
.filter(function() {
!this.name && validator.settings.debug && window.console &&
console.error( "%o has no name assigned", this);
// select only the first element for each name, and only those with
rules specified
if ( this.name in rulesCache || !validator.objectLength($(this).rules
()) )
return false;
rulesCache[this.name] = true;
return true;
});