Make datepicker textbox readonly

2 posts, 0 answers
  1. Preeti
    Preeti avatar
    4 posts
    Member since:
    Jan 2014

    Posted 19 Jun 2014 Link to this post

    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,

  2. Alexander Popov
    Alexander Popov avatar
    1411 posts

    Posted 20 Jun 2014 Link to this post

    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");

    Alexander Popov

    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.

  3. UI for ASP.NET AJAX banner
Back to Top