javascript - Add and init jQuery Datepicker inside jQuery Dialog on the go -


I am creating a jQuery dialog on a button click, and the Dedeker text boxes are also displayed in the dialog box of another DIV cloned Are made inside. But when I click on the text box, Date Pictures do not pop up as expected.

Enter image details here

  & lt ; div id = 'searchdialog' & gt; Blank Div ​​& lt; / Div & gt; & Lt; Div id = 'search' & gt; & Lt; Input type = 'text' id = 'arrivDate' / & gt; & Lt; Input type = 'text' id = 'deparDate' / & gt; & Lt; / Div & gt; & Lt; Button ID = "popup" onclick = "setPopupForm ()" & gt; Click & lt; / Button & gt; Function Set popup form () {$ ('# searchdialog'). html ($ ('#search'). html ()); .. $ ('# Searchdialog') ('# arrivDate') attr ('id', 'arrivDate2'); .. $ ('# Searchdialog') ('# deparDate') attr ('id', 'deparDate2') is received; $ ('# Searchdialog') Dialog ({height: 280, width: 740, resizable: wrong, model: true, dragable: true}); $ ('#Avradit 2'). Date picture ({defaultDate: "+7", conversion: true, numberofofonance: 1,}); }   

search - DIV which already exists

ContentAlolog - The content of 'search' has been added to this DIV and the text box id is named 'Arvidate 2 'And' Department 2 '. '

When a button is clicked, the "setPopupForm ()" function starts and the dialog pops up. But when I click on 'arrivDate2', then DatePicker does not open. I tried to init the picker inside the dialog but still does not work.

Please help me figure it out.

I have tried for JasonFIDLD above

The real example here is I am working. IM is trying to clone the content in Find a hotel in a dialog and when the new content ID can be changed, it can make the other two date pickers.

  var content = "
type = 'text 'Id =' arvidate '/> & lt; / div & gt; "; . $ ('#Searchdialog') HTML (content); $ ('#Arvidadet'). Dadepicor ({defaultDate: "+7", conversion: true, numberofone: 1,}); $ ('# Searchdialog') Dialog ({height: 280, width: 740, resizable: wrong, model: true, dragable: true}); P>

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -