RadDateTimePicker textbox border color in javascript

2 posts, 0 answers
  1. Jai
    Jai avatar
    34 posts
    Member since:
    May 2011

    Posted 18 Aug 2011 Link to this post


    I have requirement where i need to change the border color of RadDateTimePicker textbox and i want this through javascript.
    I mean like RadDateTimePickerTextBox.style.border = "Red".

    Can anyone tell me how can i get this for RadDateTimePicker through javascript ?

  2. Maria Ilieva
    Maria Ilieva avatar
    4017 posts

    Posted 23 Aug 2011 Link to this post

    Hi Jai,

    You have to use the approach described at the bottom of this help topic:


    You can reference the DateInput control in the clientside DateSelected handler with sender.get_dateInput().

    These are the styles that you may want to use:


    SomeStyle[0] is for the inline textbox styles, while SomeStyle[1] is for the textbox CSS classes for the respective state.

     For example:
            <script type="text/javascript">
                function Load(sender) {
                    sender.get_styles().EnabledStyle[0] += "border-color: red;";
    <telerik:RadDateTimePicker  ID="RDTP1" runat="server">
        <DateInput ClientEvents-OnLoad="Load"></DateInput>

    All the best,
    Maria Ilieva
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top