Skip to content

Commit 3992602

Browse files
$element is undefined / $error is undefined fix
I picked up an error when pulling the latest version, v2.1.0, under the options/errorPlacement method. The issue here is both $element and $error aren't defined and need merely to be renamed to reference the local variables. Hope this helps
1 parent 4036544 commit 3992602

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dist/unobtrusive-bootstrap.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
errorPlacement: function (error, element) {
2525
error.addClass('invalid-feedback');
2626

27-
if ($element.next().is(".input-group-append")) {
28-
$error.insertAfter($element.next());
27+
if (element.next().is(".input-group-append")) {
28+
error.insertAfter(element.next());
2929
} else {
30-
$error.insertAfter($element);
30+
error.insertAfter(element);
3131
}
3232
}
3333
};
3434
}
3535
else {
3636
console.warn('$.validator is not defined. Please load this library **after** loading jquery.validate.js and jquery.validate.unobtrusive.js');
3737
}
38-
})(jQuery);
38+
})(jQuery);

0 commit comments

Comments
 (0)