I've got an input using the datepicker tool from jQuery. what i am trying to do is that user has to select different date formats by which he can input the dates 1) daily 2) weekly 3) yearly
how can i select different format on change? the problem is that if one format is selected it is not changing to another
if (data == "Daily")
{
alert("abc");
$(".sysDateFields").datepicker();
}
else if (data == "Weekly")
{
}
else if (data == "Monthly")
{
alert("abc1");
$(".sysDateFields").datepicker({
changeMonth: true,
changeYear: true,
showButtonPanel: true,
dateFormat: 'MM yy',
onClose: function (dateText, inst) {
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
var year = $("#ui-datepicker-div .ui-datepicker-year :selected").val();
$(this).datepicker('setDate', new Date(year, month, 1));
}
});
}