Popup loads after page loads, can't plug datepicker into text box?

I have a page that loads and then loads the contents for a popup using ajax.

So the problem is that when I try to connect .datepicker () to a text box in a popup, it does not seem to work, and I assume this is a synchronization problem.

Posting .datepicker () occurs in the action / view, which loads the contents of the popup.

So, to summarize, the page loads, THEN it calls the action / view ajax call to load the contents of the popup. This popup has a text box that should start when the datepicker button is clicked.

It does not work, is it a matter of time?

+3
source share
3 answers

You should not worry about placing a call .datepicker()to the Ajax success function after the text field is added to the DOM. If this does not work, I do not think it is a time problem.

0
source

I think you need to bind your datepicker () method for ajax-call

0
source

Perhaps something is due to the fact that some jQuery-ui functions do not work with hidden elements? for example, did you load ajax and then bind it, and only then will it be displayed? (input bot, which is)

0
source

Source: https://habr.com/ru/post/1785466/


All Articles