[jQuery] Can't set focus on element with DatePicker applied

[jQuery] Can't set focus on element with DatePicker applied


Hello,

I'm trying to set focus on a form field but when I apply the DatePicker
plugin* it stops working. But perhaps this doesn't really have anything
to with DatePicker and is a js/jQuery thing.

Here's the relevant code:

js:

$("#date").focus();
$("#date").datePicker();

HTML:

<input id="date" ... />

If I comment the datePicker() line it works fine.

I even tried selecting focus with something other than the id e.g.
$("input[@name=date]").focus(); but I don't like that method and it
doesn't work anyway.



Thanks,
Chris.

* http://www.kelvinluck.com/assets/jquery/datePicker/