Reputation: 85
I have created following code for selecting the current date in the textbox.
$('#rstStartDTM').data("DateTimePicker").minDate(new Date("01/01/1970"));
$('#rstStartDTM').data("DateTimePicker").maxDate(
new Date($.now()));
rstStartDTM
is my textbox
id.
But it is not reflecting in the textbox. Can anyone help me to solve this issue. Thank you.
Upvotes: 0
Views: 72
Reputation: 1369
Have a look at this js fiddle :- Date picker default date
$('#rstStartDTM').datetimepicker();
$('#rstStartDTM').data("DateTimePicker").date(new Date());
Upvotes: 2
Reputation: 1
$(document).ready(function () {
$('#rstStartDTM').datepicker({
dateFormat: "dd-mm-yy"
});
});
</script>
You can try this first and then in your textbox set attribute ClientIDMode="Static" and then set another attribute AutoPostBack="True"
Upvotes: 0