On Feb 14, 8:42 am, Jon <cakeordeat...@gmail.com> wrote:
> With the validation i have managed to make it add a class called
> 'Valid' to the label that the validation adds. However i want to make
> it add a class (same name) to the textbox too. I've managed this by
> doing:
>
> success: function(element) {
> $(element).addClass("Valid").parent("span").children("input,
> textarea").addClass("Valid")
> },
>
> Which works fine. However if you add text to the textbox - so it's
> valid - then remove the text - so it's not valid - the Valid class is
> removed from the label but not from the textbox.
>
> Is there an easier way to do what i'm doing?
Add and remove the class on the parent span and make the rule
particular to the input and textarea elements (perhaps that isn't
required if they are the only descendants that will respond to the
rule anyway).
--
Rob