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

RadInputManager - Apply class client-side to target control

1 Answer 106 Views
Input
This is a migrated thread and some comments may be shown as answers.
ADH
Top achievements
Rank 1
ADH asked on 20 Oct 2010, 10:37 PM
I've noticed that while I can force a style onto a target control using Javascript, such as changing the border or the color of the text, I cannot force a new class onto a target control. The commands simply don't seem to work. Is there a way to do this? I'm looking at doing something like the code below, which makes extensive use of jQuery.

$("input[Validators]").each(function() {
    var validators = $(this).attr("Validators");
    if (validators) {
        var isValid = true;
        $(validators).each(function() {
            if (this.isvalid !== true) isValid = false;
        });
 
        //This works:
        var strColor=isValid?"#fff":"#cc0000";
        $(this).css("color", strColor);
 
        //This does not:
        if (isValid) $(this).removeClass("ValidationError");
        else $(this).addClass("ValidationError");
    }
});

It appears that the RadInputManager control might have some way of controlling or maintaining the classes applied to each field, and I might need a way to thwart it. If there were an official, documented way to do this, I'd be glad to use that, but I did search and had no luck finding one - perhaps my documentation's a bit out of date, but a site search didn't turn anything up either.

1 Answer, 1 is accepted

Sort by
0
Accepted
Dimo
Telerik team
answered on 25 Oct 2010, 02:03 PM
Hello ADH,

I recommend you to use the RadInputManager's invalid state for the textboxes and possibly a custom invalid-style appearance, which can be achieved with declaratively set custom CSS classes.

http://www.telerik.com/community/forums/aspnet-ajax/input/showing-error-style-programmatically.aspx

By the way, please avoid posting duplicate forum threads and support tickets on the same subject.

Regards,
Dimo
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Input
Asked by
ADH
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Share this question
or