I am trying to trigger a datepicker() object on input textboxes. So all inputs with the .dateField class would trigger a datepicker() on click/focus. But it isnt working.
It does not work the first time i click. If i click outside the box and then again click inside the box, it works.
$(".dateField").bind('click focus change', function(){
$(this).datepicker();
})
The
datepickerfunction equips your input with all the needed callbacks and code.It is not meant to be called as a reaction to “click” or “focus”.
It should be called only once, at initialization :