Hi,
I am trying to change the border and background DateInput control. I would like to change the border to red with yellow background, and the triangle with ! in middle if possible or something to that affect. I tried a Custom Validator but with no luck. I would settle for a red border around the Data Input text box.
I have tried every which way; but to no success..Can this be done? If so, any suggestions?
Thanks in advance,
Gary
I am trying to change the border and background DateInput control. I would like to change the border to red with yellow background, and the triangle with ! in middle if possible or something to that affect. I tried a Custom Validator but with no luck. I would settle for a red border around the Data Input text box.
I have tried every which way; but to no success..Can this be done? If so, any suggestions?
Thanks in advance,
Gary
telerik:RadDatePicker ID="datepicker" runat="server" ClientEvents-OnDateSelected="DateValidator"
MaxDate="2100-12-31" MinDate="1900-01-01"
Culture="English (United States)" SelectedDate="2011-03-01" >
<
Calendar
runat
=
"server"
UseRowHeadersAsSelectors
=
"False"
UseColumnHeadersAsSelectors
=
"False"
ViewSelectorText
=
"x"
FastNavigationStep
=
"12"
></
Calendar
>
<
DatePopupButton
ImageUrl
=
""
HoverImageUrl
=
""
CssClass
=
""
></
DatePopupButton
>
<
DateInput
ID
=
"DI"
runat
=
"server"
CausesValidation
=
"true"
DisplayDateFormat
=
"M/d/yyyy"
DateFormat
=
"M/d/yyyy"
LabelCssClass
=
""
Width
=
""
SelectedDate
=
"2011-03-01"
>
<
ClientEvents
OnValueChanged
=
"ValueChanged"
/>
</
DateInput
>
</
telerik:RadDatePicker
>
</
form
>
</
body
>
</
html
>
<
telerik:RadScriptBlock
ID
=
"SOSRadScriptBlock"
runat
=
"server"
>
<
script
type
=
'text/javascript'
>
function ValueChanged(sender, args) {
var dtv = $find(sender.controltovalidate).get_dateInput();
var temp = args.Value.trim();
if (temp != " " && !!temp) {
args.IsValid = true;
} else {
//date input value is either null or has a space
dtv._invalid = true;
//Below is the last approach I tried to change the style
dtv.get_styles().InvalidStyle[0] += "background-color: lemonchiffon;";
dtv.updateCssClass();
args.IsValid = false;
}
</
script
>
</
telerik:RadScriptBlock
>