How do I attach a JQuery Mobile DatePicker dynamically to an input field ?
I tried using ui-datepicker, but I think the plugin attaches Calendar to the input field that has the required markup. How do I dynamically attach a calendar using Javascript ? I tried the following
$("#datep").after( $( "<div />" ).datepicker({
altField: "#datep"
}) );
but the Calendar does not hide after the date has been chosen.
I also explored jQM-DateBox2, but couldn’t figure out a way to attach calendar dynamically.
Any help would be appreciated.
To do this with DateBox, you could do something like:
OR, you could add the input field wherever you like, and then