jquery - stop parsley js firing keyup when tabbing -


i have fields have keyup , blur events set on them. works great parsley js validation until comes when user tabs field has keyup on it. triggers error right away when user tabbed field. before user gets enter error. there way stop happening without removing keyup event.

 <input type="text" value="" placeholder="xxxx-xxxx-xxxx-xxxx" class="card" id="card" name="number" pattern="[0-9]*" data-trigger="blur keyup" data-required="true" data-validation-minlength="0" > 
  • right click input field, click out again error triggered blur event.
  • click filed start type if user types incorrect value keyup fire.

the above work great.

  • click input field before card filed tab card input filed next index keyup fired right away.

the above scenario 1 want stop happening until user keyups inside input field.

ok runs issue 1 way sort out. set focusin event on card input. make sure don't use in parsley event-trigger attribute. remove parsley checking event on focusin event. set timeout can replace in after parsley has gotten on it's initial required validation.

kind of hacky know , don't using timers in case works. tried 100 , worked browsers except ie had increase 200 ie compensation.

$('.card').focusin(function(){      $('form').parsley( 'removeitem', '#card' );     settimeout(function(){         getcurrentform().parsley( 'additem', '#card' );     },200); }); 

hope helps questions ever ask parsley never reply. seems parsley not common questions. hasn't used parsley js it's , amazing validation library should checkout.


Comments