Click here to Skip to main content
15,920,956 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to set date to Datepicker text box in edit case.

I wrote below code for create
$('#txtDate').datepicker({
            format: "dd/mm/yyyy",
			autoclose: true,
			todayHighlight: true
        });


same text box, i am using edit case also, i need to set database date to textbox.

Thank you.

What I have tried:

$('#txtDate').val(Date);

$('#txtDate').Datepicker('setdate', date)
Posted
Updated 4-Jan-17 20:51pm

1 solution

Hi. This worked for me:

$('document').ready(function () {
          $('#txtDate').datepicker({
              dateFormat: 'dd/mm/yy',
              ...//other
                });
       });

maybe you just need to add the document ready
 
Share this answer
 
v2
Comments
sampath1750 5-Jan-17 7:26am    
in insert case it is working fine, but upadte case need to set previously date this case it is not working means need to set previously selected date to textbox.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900