From 22f5421facd4fa2a6663a7721d407ac030c29598 Mon Sep 17 00:00:00 2001 From: Adonis Karavokyros Date: Wed, 19 Mar 2014 10:12:19 +0100 Subject: [PATCH] [*] FO use focusout for validate fields Wait the user finish to complete a field for show him errors ("less agressive") --- js/validate.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/validate.js b/js/validate.js index 450cc9c0901c8..582f7b64b653c 100644 --- a/js/validate.js +++ b/js/validate.js @@ -173,7 +173,7 @@ function validate_isPasswd(s) return (s.length >= 5 && s.length < 255); } -$(document).on('keyup blur', 'input.validate, textarea.validate', function() { +$(document).on('focusout', 'input.validate, textarea.validate', function() { if ($(this).hasClass('is_required') || $(this).val().length) { if ($(this).attr('name') == 'postcode' && typeof(countriesNeedZipCode[$('#id_country option:selected').val()]) != 'undefined') @@ -186,4 +186,4 @@ $(document).on('keyup blur', 'input.validate, textarea.validate', function() { else $(this).parent().addClass('form-error').removeClass('form-ok'); } -}); \ No newline at end of file +});