I am trying to set border style of the RadComboBox control on client side to red on fail of validation. I am using Custom validator control, but the border doesnt seem to change. Can you please review my code and let me know what am I doing?
<telerik:RadComboBox runat="server" ID="radCbLicenseSt" Width="55px" Height="300px" ></telerik:RadComboBox> |
<asp:CustomValidator ID="cvLicensest" runat="server" ControlToValidate="radCbLicenseSt" ValidateEmptyText="true" ClientValidationFunction="ReqFieldValidationCBox" CssClass="error" EnableClientScript="true" Display="Dynamic" ValidationGroup="Enrollment" /> |
function ReqFieldValidationCBox(source, arguments) |
{ |
var Cbox = $find(source.controltovalidate); |
if (Cbox) |
{ |
if (Cbox.get_value() == "") |
{ |
Cbox.get_inputDomElement().style.bordercolor = "red"; |
Cbox.get_inputDomElement().style.borderwidth = "1px"; |
arguments.IsValid = false; |
} |
else |
{ |
arguments.IsValid = true; |
} |
} |
} |