Skip to content

Commit 60cb1ae

Browse files
committed
Merge pull request #796 from bygiro/master
Added ignore field feature
2 parents e0663cc + 3d19ab9 commit 60cb1ae

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

js/jquery.validationEngine.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,9 @@
516516
++$.validationEngine.fieldIdCounter;
517517
}
518518

519+
if(field.hasClass(options.ignoreFieldsWithClass))
520+
return false;
521+
519522
if (!options.validateNonVisibleFields && (field.is(":hidden") && !options.prettySelect || field.parent().is(":hidden")))
520523
return false;
521524

@@ -2014,8 +2017,10 @@
20142017
focusFirstField:true,
20152018
// Show prompts, set to false to disable prompts
20162019
showPrompts: true,
2017-
// Should we attempt to validate non-visible input fields contained in the form? (Useful in cases of tabbed containers, e.g. jQuery-UI tabs)
2018-
validateNonVisibleFields: false,
2020+
// Should we attempt to validate non-visible input fields contained in the form? (Useful in cases of tabbed containers, e.g. jQuery-UI tabs)
2021+
validateNonVisibleFields: false,
2022+
// ignore the validation for fields with this specific class (Useful in cases of tabbed containers AND hidden fields we don't want to validate)
2023+
ignoreFieldsWithClass: 'ignoreMe',
20192024
// Opening box position, possible locations are: topLeft,
20202025
// topRight, bottomLeft, centerRight, bottomRight, inline
20212026
// inline gets inserted after the validated field or into an element specified in data-prompt-target
@@ -2087,5 +2092,3 @@
20872092
}};
20882093
$(function(){$.validationEngine.defaults.promptPosition = methods.isRTL()?'topLeft':"topRight"});
20892094
})(jQuery);
2090-
2091-

0 commit comments

Comments
 (0)