Skip to content

Commit

Permalink
Core: trigger events for elements outside their form
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonHeimberg committed Oct 26, 2018
1 parent 793ef9a commit aa6c72c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ $.extend( $.validator, {
// Support: Chrome, oldIE
// "select" is provided as event.target when clicking a option
.on( "click.validate", "select, option, [type='radio'], [type='checkbox']", delegate );
$( this.currentForm.elements ).filter( function( i, el ) {
return $(el).closest(el.form).length === 0;
} )
.filter(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'], " +
"[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], " +
"[type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'], " +
"[type='radio'], [type='checkbox'], [type='button']")
.on( "focusin.validate focusout.validate keyup.validate", delegate).end()
.filter("select, option, [type='radio'], [type='checkbox']").on( "click.validate", delegate);

if ( this.settings.invalidHandler ) {
$( this.currentForm ).on( "invalid-form.validate", this.settings.invalidHandler );
Expand Down

0 comments on commit aa6c72c

Please sign in to comment.