Javascript – jQuery UI datepicker: move to the next field after date select

javascriptjqueryjquery-uijquery-ui-datepicker

I've created a web form that uses the jQuery-UI datepicker. When a date is selected, the focus on the textbox where the date is entered is lost.

I would like to make the focus either stay in the datepicker-enabled textbox or else move to the text element on my web form. Is this possible?

Best Answer

$('.selector').datepicker({
   onClose: function(dateText, inst) {
      $(this).focus();
   }
});

http://jsfiddle.net/HNeF9/