Auto focus on next input field


/ Published in: jQuery
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $(document).ready(function(){
  2. $('#day').bind('keyup', jumpToMonth);
  3. $('#month').bind('keyup', jumpToYear);
  4. });
  5.  
  6. function jumpToMonth()
  7. {
  8. if($('#day').val().length >= 2){
  9. $('#month').focus();
  10. }
  11. }
  12.  
  13. function jumpToYear()
  14. {
  15. if($('#month').val().length >= 2){
  16. $('#year').focus();
  17. }
  18. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.