Skip to content

Commit be6e98e

Browse files
committed
victorjonsson#540 Don't take for granted that the validated input is contained within a form element
1 parent 49ce4fe commit be6e98e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/jquery-plugins.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,8 @@
137137
var language = $.extend({}, $.formUtils.LANG, lang || {});
138138
this.each(function() {
139139
var $elem = $(this),
140-
formDefaultConfig = $elem.closest('form').get(0).validationConfig || {};
140+
$closestForm = $elem.closest('form').get(0) || {},
141+
formDefaultConfig = $closestForm.validationConfig || {};
141142

142143
$elem.one('validation', function(evt, isValid) {
143144
if ( typeof cb === 'function' ) {

0 commit comments

Comments
 (0)