argyle
argyle

Reputation: 1339

jQuery datepicker focus after click day of month

I am noticing that jQuery datepicker is neither activating the current element nor the next element in the tab index after tabbing into a field spawns a datepicker instance and the mouse is used to click on a day.

<input type="text" id="no1" />
<input type="text" id="no2" />
<input type="text" id="no3" />

$('#no2').datepicker();
$('#no1').focus();

If you check out http://jsfiddle.net/DgkJZ/1/

and tab to the second field, click a date, you'll see what I mean about the tab focus going nowhere. Is there some way around this that doesn't involve editing jQuery UI source?

Upvotes: 0

Views: 1726

Answers (1)

Rab
Rab

Reputation: 35572

Try to catch the onSelect and set focus accordingly

$('#no2').datepicker( {
    onSelect: function() {
       $('#no3').focus();
    }
);

Upvotes: 1

Related Questions