From 1bacb09005a753748833efd6e3a0e037b6520023 Mon Sep 17 00:00:00 2001 From: opalenet-serge Date: Wed, 8 Jan 2014 16:20:39 -0500 Subject: [PATCH 1/2] placeholder interfer with required couldn't have a valid value for a placeholder ex : placeholder '999' in an required integer field --- js/jquery.validationEngine.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/js/jquery.validationEngine.js b/js/jquery.validationEngine.js index 78a363c..361c64e 100644 --- a/js/jquery.validationEngine.js +++ b/js/jquery.validationEngine.js @@ -915,11 +915,9 @@ default: var field_val = $.trim( field.val() ); var dv_placeholder = $.trim( field.attr("data-validation-placeholder") ); - var placeholder = $.trim( field.attr("placeholder") ); if ( ( !field_val ) || ( dv_placeholder && field_val == dv_placeholder ) - || ( placeholder && field_val == placeholder ) ) { return options.allrules[rules[i]].alertText; } From 5b9cbe14355db5e1fac26379c6888923f2ac648b Mon Sep 17 00:00:00 2001 From: opalenet-serge Date: Thu, 9 Jan 2014 12:44:33 -0500 Subject: [PATCH 2/2] fadeOut with showPrompt doing a "fade" in the _closePrompt instead of directly the "remove" would cause the field to be removed from the page wright after a call to showPrompt --- js/jquery.validationEngine.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/js/jquery.validationEngine.js b/js/jquery.validationEngine.js index 361c64e..3adb7cc 100644 --- a/js/jquery.validationEngine.js +++ b/js/jquery.validationEngine.js @@ -1714,12 +1714,24 @@ * field */ _closePrompt: function(field) { - var prompt = methods._getPrompt(field); - if (prompt) - prompt.fadeTo("fast", 0, function() { - prompt.parent('.formErrorOuter').remove(); - prompt.remove(); - }); + var prompt = methods._getPrompt(field); + + var form = $(field).closest('form, .validationEngineContainer'); + var options = form.data('jqv'); + var useFade = options ? options.useFadeOnClosePrompt : true; + if (prompt) { + var removePrompt = function(){ + prompt.parent('.formErrorOuter').remove(); + prompt.remove(); + } + + if (useFade) { + prompt.fadeTo("fast", 0, removePrompt); + } else { + removePrompt(); + } + } + }, closePrompt: function(field) { return methods._closePrompt(field);