From 569455a7ffecfe5b61d4c55f7e324fa421b16c7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Gaillard?= Date: Mon, 4 Nov 2013 19:26:51 +0100 Subject: [PATCH] // fix on front validators --- .../default-bootstrap/js/validate_fields.js | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/themes/default-bootstrap/js/validate_fields.js b/themes/default-bootstrap/js/validate_fields.js index a06a47fee..ae60af671 100644 --- a/themes/default-bootstrap/js/validate_fields.js +++ b/themes/default-bootstrap/js/validate_fields.js @@ -22,14 +22,12 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA */ -$(document).ready(function() { - $('input.validate, textarea.validate').on('keyup', function() { - if ($(this).hasClass('is_required') || $(this).val().length) - { - if (window['validate_'+$(this).attr('data-validate')]($(this).val())) - $(this).parent().removeClass('form-error').addClass('form-ok'); - else - $(this).parent().addClass('form-error').removeClass('form-ok'); - } - }); -}); +$(document).on('keyup', 'input.validate, textarea.validate', function() { + if ($(this).hasClass('is_required') || $(this).val().length) + { + if (window['validate_'+$(this).attr('data-validate')]($(this).val())) + $(this).parent().removeClass('form-error').addClass('form-ok'); + else + $(this).parent().addClass('form-error').removeClass('form-ok'); + } +}); \ No newline at end of file