i have dropdown for selecting data type of data in a textbox. dropdown options are like integer, decimal,string,date.
everything is working fine except one thing that is am unable to get a datepicker to the text box when dropdown is selected to date.
tried something like but failed to achieve
$(function () {
$(".date1").datepicker({
changeMonth: true,
changeYear: true,
numberOfMonths: 1
});
});
$("#<%=ddlDataType.ClientID %>").change(function () {
if ($('#<%=ddlDataType.ClientID %> option:selected').text().toLowerCase() == "date") {
$("#<%=txtDefaultValue.ClientID%>").prop("class", "date1");
}
else {
$("#<%=txtDefaultValue.ClientID%>").prop("class", "");
}
});
what is the possible way to achieve this.