I like the jQuery DatePicker widget. It is very convenient that when a user clicks on a date field in his web application, the user sees a dialog that allows her to select a date.
Which is even better, since the date picker is so unobtrusive. If the user does not want to use datepicker, she can easily enter the date on her own. In addition, the datepicker automatically disappears when the user clicks on anything that is not a datepicker, or switches focus to another field.
What I would like to do is the same functions as in the jQuery dialog. Basically, I want to create a dialog with some widgets that the user can use to select a value for a text field.
I want the dialog box to automatically appear below the text box when the field is selected. I want it to disappear automatically after the user switches focus somewhere else.
To do this, I attached a handler to the .focus event text field in jQuery to open a dialog box. This works great. :-)
I tried to add a handler to the .blur event .blur that the dialog box .blur automatically when the user has moved to another place. However, simply opening the dialog box raises the blur event to fire, closing it: - /
In addition, I do not know how to make the dialog appear directly below the text box in the same way as datepicker does.
How can I create a jQuery dialog next to a text box and disappear accordingly, like a datepicker?
source share