开发者

jqueryui datepicker appears every time dialog is envoked

开发者 https://www.devze.com 2023-01-15 21:48 出处:网络
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.Is the element

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.


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消