Skip to content

Commit

Permalink
Core: Fetch all elements of form(jquery-validation#2156)
Browse files Browse the repository at this point in the history
  • Loading branch information
garima authored and garima committed Feb 12, 2019
1 parent 5db59ef commit b508603
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core.js
Expand Up @@ -625,8 +625,10 @@ $.extend( $.validator, {
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm ).fields()
.filter( "input, select, textarea, [contenteditable]" )
console.error( $.merge( $( this.currentForm ).find( "input, select, textarea, [contenteditable]" ),
$( this.currentForm.elements ).filter( "input, select, textarea, [contenteditable]" ) ) );
return $.merge( $( this.currentForm ).find( "input, select, textarea, [contenteditable]" ),
$( this.currentForm.elements ).filter( "input, select, textarea, [contenteditable]" ) )
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down Expand Up @@ -664,7 +666,7 @@ $.extend( $.validator, {

errors: function() {
var errorClass = this.settings.errorClass.split( " " ).join( "." );
return $( this.settings.errorElement + "." + errorClass );
return $( this.settings.errorElement + "." + errorClass, this.errorContext );
},

resetInternals: function() {
Expand Down

0 comments on commit b508603

Please sign in to comment.