Skip to content

Instantly share code, notes, and snippets.

@cmnstmntmn
Created April 1, 2015 12:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmnstmntmn/9613d64ac412782821f9 to your computer and use it in GitHub Desktop.
Save cmnstmntmn/9613d64ac412782821f9 to your computer and use it in GitHub Desktop.
var dayInput = $('input[name=day]');
var monthInput = $('input[name=month]');
var yearInput = $('input[name=year]');
$(document).on('keyup', dayInput, monthInput, yearInput, function(e){
if (dayInput.val().length == 2){
monthInput.focus();
}
if (monthInput.val().length == 2){
yearInput.focus();
}
if (yearInput.val().length == 4){
$('.js-dob').focus();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment