I am working on some custom form validation. I need help with my selector.
Here is my ideal solution ( in English ):
1. Get all Elements in #myForm that have a class containing the string "error". Include checkboxes and radio's.
2. For each of those elements:
a) Check to see if the element has a class of "ok-class".
[YES] Remove that class
b) Add class "Errror" to element
c) Find the very next SPAN element. Remove any classes in this tag. Add Class "span-error"
Thanks! This is a little complex for me. I think I could do this one statement at a time, but to write a "chained" statement is a little out of my league.
Can't wait to see some solution ideas!