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

RadDateTimePicker textbox border color in javascript

1 Answer 125 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jai
Top achievements
Rank 1
Jai asked on 18 Aug 2011, 12:23 PM
Hi,

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 ?

Thanks,
--Jai

1 Answer, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 23 Aug 2011, 11:53 AM
Hi Jai,

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

http://www.telerik.com/help/aspnet-ajax/input_clientsidebasics.html

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:

EnabledStyle
HoveredStyle
FocusedStyle

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

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


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 >>

Tags
Input
Asked by
Jai
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Share this question
or