jquery date picker for dynamic input
This example shows how to use jquery date picker for dynamic fields.
by Ivan Septian
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css">
<div id="content">
a datepicker <input class="datepicker_recurring_start"/>
</div>
<button id="cmd">add a datepicker</button>
JavaScript
$('#cmd').click(function(){
$('#content').append('<br>a datepicker <input class="datepicker_recurring_start"/>');
});
$('body').on('focus',".datepicker_recurring_start", function(){
$(this).datepicker({
dateFormat: "yy-mm-dd",
changeMonth: true,
changeYear: true,
yearRange :"1900:2030"
});
});