jquery - Input field not registering javascript event on first click/focus -


I am trying to trigger a datepicker () object on the input text box. Therefore, all inputs with the .datefield class Will trigger a diecker (click) on click / focus but it does not work. This does not work for the first time when I click. If I click outside the box and then click inside the box again, then it works.

  $ ("dateField"). Dump ('click on focus change', function () {$ (this) .datepicker ();})    

Duplicator functions fits your input with your required callback and code.

This is not to call as a response to "click" or "focus".

It should be called only once on startup:

  $ (function () {$ (". DateField"). Datepicker ();});    

Comments