From 4efe41c4ba7af50fc5bc8b455ef84f09bc739d4b Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Sat, 13 Jun 2015 01:52:37 +0200 Subject: [PATCH 1/2] Support onBeforePromptType callback function. --- js/jquery.validationEngine.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/jquery.validationEngine.js b/js/jquery.validationEngine.js index ef88e0f..94bdd6e 100644 --- a/js/jquery.validationEngine.js +++ b/js/jquery.validationEngine.js @@ -728,6 +728,10 @@ } } + if (typeof errorMsg == 'string' && options.onBeforePromptType){ + options.onBeforePromptType(field); + } + //funcCallRequired, first in rules, and has error, skip anything else if( i==0 && str.indexOf('funcCallRequired')==0 && errorMsg !== undefined ){ promptText += errorMsg + "
"; From b345eef78d6c807760fb90fbe6faa9afaf811040 Mon Sep 17 00:00:00 2001 From: Mariusz Krzaczkowski Date: Sat, 13 Jun 2015 16:10:07 +0200 Subject: [PATCH 2/2] Added ability to disable validation for the fields in a particular element --- js/jquery.validationEngine.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/jquery.validationEngine.js b/js/jquery.validationEngine.js index 94bdd6e..7e04868 100644 --- a/js/jquery.validationEngine.js +++ b/js/jquery.validationEngine.js @@ -548,7 +548,7 @@ if(field.hasClass(options.ignoreFieldsWithClass)) return false; - if (!options.validateNonVisibleFields && (field.is(":hidden") && !options.prettySelect || field.parent().is(":hidden"))) + if (field.closest('.noValidate').length > 0 || !options.validateNonVisibleFields && (field.is(":hidden") && !options.prettySelect || field.parent().is(":hidden"))) return false; var rulesParsing = field.attr(options.validateAttribute); @@ -2110,6 +2110,7 @@ onFieldFailure: false, onSuccess: false, onFailure: false, + onBeforePromptType: false, validateAttribute: "class", addSuccessCssClassToField: "", addFailureCssClassToField: "",