Have to click twice to initiate datepicker. Alert solves it. Why?
Hello..
I have trouble with datepicker and I dont understand it. This is my code:
- $("#mytextbox").click(function(){
- $("#mytextbox").datepicker();
- })
If I want to show calendar for the first time I have to click three times. First click to the textbox, second one anywhere else and third click again to textbox. But if I write this:
- $("#mytextbox").click(function(){
- $("#mytextbox").datepicker();
- alert("useless alert");
- })
... calendar appears after the first click to the textbox when the alert window is closed.
Does anybody know why?
I tried to solve it using bind / unbind functions, but did not succeed.