Skip to content

Commit

Permalink
Core: check related form elements outside of the form
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeimberg committed Oct 30, 2018
1 parent e83a240 commit 4a14d51
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,13 @@ $.extend( $.validator, {
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( "input, select, textarea, [contenteditable]" )
var $elements;
if ( this.currentForm.elements ) {
$elements = $( this.currentForm ).find( "[contenteditable]" ).add( this.currentForm.elements );
} else {
$elements = $( this.currentForm ).find( "input, select, textarea, [contenteditable]" );
}
return $elements
.not( ":submit, :reset, :image, :disabled" )
.not( this.settings.ignore )
.filter( function() {
Expand Down

0 comments on commit 4a14d51

Please sign in to comment.