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 26, 2018
1 parent e83a240 commit 793ef9a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/core.js
Expand Up @@ -623,8 +623,12 @@ $.extend( $.validator, {
rulesCache = {};

// Select all valid inputs inside the form (no submit or reset buttons)
return $( this.currentForm )
.find( "input, select, textarea, [contenteditable]" )
if ( this.currentForm.elements ) {
var $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 793ef9a

Please sign in to comment.