Prafulla
Prafulla

Reputation: 85

Selecting Current Date

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

Answers (2)

Lalit
Lalit

Reputation: 1369

Have a look at this js fiddle :- Date picker default date

$('#rstStartDTM').datetimepicker();
$('#rstStartDTM').data("DateTimePicker").date(new Date());

Upvotes: 2

Phoenix
Phoenix

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

Related Questions