This is a migrated thread and some comments may be shown as answers.

Make datepicker textbox readonly

1 Answer 319 Views
Date/Time Pickers
This is a migrated thread and some comments may be shown as answers.
Preeti
Top achievements
Rank 1
Preeti asked on 19 Jun 2014, 06:00 AM
Hi Team,

I want to make date picker textbox readonly so that user can only select the date from picker,but can not edit,so I do not need to do the client side validation any more.

and the next thing is I want to display the date in .Format("dd MMM yyyy") format,but while passing this valuse to server,I want it to be in default dd-MM-yyyy format

Can you please help me out in doing this.

Thanks & Regards,

Preeti

1 Answer, 1 is accepted

Sort by
0
Alexander Popov
Telerik team
answered on 20 Jun 2014, 03:46 PM
Hello Preeti,

Disabling the input could be achieved by adding a readonly attribute to the DatePicker's input element, as shown in this example. I am not aware how the DatePicker's value is being passed to the server in your application, but changing the formatting could be done using the toString method. For example: 
date = kendo.toString(datepicker.value(), "dd-MM-yyyy");

Regards,
Alexander Popov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Date/Time Pickers
Asked by
Preeti
Top achievements
Rank 1
Answers by
Alexander Popov
Telerik team
Share this question
or