// fix on front validators

This commit is contained in:
Rémi Gaillard committed 2013-11-04 19:26:51 +01:00
1 parent 8dc29b20f0
commit 569455a7ff
1 file changed
+1 -3
@@ -22,8 +22,7 @@
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
$(document).ready(function() { $(document).on('keyup', 'input.validate, textarea.validate', function() {
$('input.validate, textarea.validate').on('keyup', function() {
if ($(this).hasClass('is_required') || $(this).val().length) if ($(this).hasClass('is_required') || $(this).val().length)
{ {
if (window['validate_'+$(this).attr('data-validate')]($(this).val())) if (window['validate_'+$(this).attr('data-validate')]($(this).val()))
@@ -31,5 +30,4 @@ $(document).ready(function() {
else else
$(this).parent().addClass('form-error').removeClass('form-ok'); $(this).parent().addClass('form-error').removeClass('form-ok');
} }
});
}); });