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.
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.
$(
"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.