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

<InvalidStyle> ignored

1 Answer 90 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
K
Top achievements
Rank 1
K asked on 04 Aug 2011, 10:47 PM
Why is my <InvalidStyle> tag being ignored on all of my RadControls? It insists on using the default. Version 2011.2.712.40

ASP.Net snippet
<telerik:RadTextBox ID="txtFirstName" CausesValidation="true" EmptyMessage="Enter First Name"
      MaxLength="100" runat="server" SelectionOnFocus="SelectAll" AutoCompleteType="FirstName" Width="240px">
    <InvalidStyle CssClass="input_box_error" />
</telerik:RadTextBox>

CSS class I want applied (namely, custom bg image)
.input_box_error {
background-color: #FCF7F7;
color:#333;
border: 1px solid #990000;
Background-image: url(web_images/icon_input_error.png);
background-position:right;
}

Javascript validation method
function validateFirstName(sender, args) {
            var tb = $find("<%= txtFirstName.ClientID %>");
            if (tb.get_value() == "") {
                tb._invalid = true;
                tb.updateCssClass();
                args.IsValid = false;
            }
            else {
                tb._invalid = false;
                tb.updateCssClass();
                args.IsValid = true;
            }
        }

The default style that's being applied:
html body .RadInput_Default .riError, html body .RadInput_Error_Default
{
border-top-color: #d51923;
border-right-color-value: #d51923;
border-bottom-color: #d51923;
border-left-color-value: #d51923;
border-left-color-ltr-source: physical;
border-left-color-rtl-source: physical;
border-right-color-ltr-source: physical;
border-right-color-rtl-source: physical;
background-color: #ffffff;
background-image: url("WebResource.axd?d=Pl-AEyM6jqu8ijnVblcTiccZs9g-fx3RblQsV5LQ2xg8VP_Hxt2xcHsDuXiwDfB8GPPz5PpcKKZImQCrk72Jq3nUpEh_RIWAGLrotZeEzHhmO1hmMkfKXxD79gitj70HcRZKnaksvfXoqOK93XI3ITGi1zI1&t=634459979340000000");
background-repeat: no-repeat;
background-attachment: scroll;
background-position: 100% -298px;
background-clip: border-box;
background-origin: padding-box;
background-size: auto auto;
color: #d51923;
}

1 Answer, 1 is accepted

Sort by
0
K
Top achievements
Rank 1
answered on 04 Aug 2011, 10:59 PM
I think I figured out my problem, minutes after posting, of course. 'CssClass' does not appear to be a valid attribute of the <InvalidStyle> tag? I swear I picked that up from example code elsewhere. Anyhow, I simply overrode the default style like so:

html body .RadInput_Default .riError, html body .RadInput_Error_Default {
background-color: #FCF7F7 !important;
color:#333 !important;
border: 1px solid #990000 !important;
Background-image: url(web_images/icon_input_error.png) !important;
background-position:right !important;
}

True, one can set most of those properties with attributes but not the background image.
Tags
General Discussions
Asked by
K
Top achievements
Rank 1
Answers by
K
Top achievements
Rank 1
Share this question
or