views:

25

answers:

2

any help is much appreciated. Everytime: $("#myid").dialog() is opened, my datepicker also pops out, I didnt even click the input field of it. Why is so? tnx in advance.

+1  A: 

Is the element with the datepicker the first "tab-able" item within the modal? If so, it is being auto-focused, and unfortunately there are no options to not auto-focus on open.

The only solutions I can think of are to...

  1. Put some other element before the datepicker that can receive focus, or
  2. Don't atach the datepicker behavior on dom load, and rather do it inside of the dialog's "open" callback
jmar777
wow, you guys are so cool, yes: date is the first tab. thanks much.
iamcocoy
A: 

What type of control is myid? If it is a textbox you will most likely be getting the date picker because the dialog box does invoke that control.

If your myid field is in the dialog box, ensure that it's not the first field entered.

You also might want to attach the date picker when the dialog is finished opening.

But as Teja recommended, some markup + scripts would be nice.

Ryan Ternier
tnx dude,cool..
iamcocoy