8000 Core: Ignore elements that belong to other/nested forms · Arkni/jquery-validation@c0f1bf1 · GitHub
[go: up one dir, main page]

Skip to content

Commit c0f1bf1

Browse files
committed
Core: Ignore elements that belong to other/nested forms
Ref jquery-validation#704 Ref jquery-validation#1970 Fixes jquery-validation#2035
1 parent 7208887 commit c0f1bf1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/core.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,11 @@ $.extend( $.validator, {
631631
this.name = name;
632632
}
633633

634+
// Ignore elements that belong to other/nested forms
635+
if ( this.form !== validator.currentForm ) {
636+
return false;
637+
}
638+
634639
// Select only the first element for each name, and only those with rules specified
635640
if ( name in rulesCache || !validator.objectLength( $( this ).rules() ) ) {
636641
return false;

0 commit comments

Comments
 (0)
0