Skip to content

Commit

Permalink
[*] FO use focusout for validate fields
Browse files Browse the repository at this point in the history
Wait the user finish to complete a field for show him errors ("less agressive")
  • Loading branch information
prestarocket committed Mar 19, 2014
1 parent 667741a commit 22f5421
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -186,4 +186,4 @@ $(document).on('keyup blur', 'input.validate, textarea.validate', function() {
else
$(this).parent().addClass('form-error').removeClass('form-ok');
}
});
});

0 comments on commit 22f5421

Please sign in to comment.