Posted By

dsoms on 04/28/11


Tagged

javascript input auto jquery focus field


Versions (?)

Auto focus on next input field


 / Published in: jQuery
 

  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  

You need to login to post a comment.