Hi, I'm implementing a generic form validation script for a site that
I'm working on.
When validation fails for an input of a given id, it uses the $$
function to select all elements with a class of "validationFail_{input
ID here}" and shows them. The goal is to have elements on the page that
can be displayed when validation fails and hidden when it succeeds or
the other way around.
The $$ has never really been a performance problem for me in the past,
however I suspect that the quantity of "classic" HTML development done
way before I was working on this site is making the function iterate
over a great amount of elements.
So, my question is:
Is there a way to make the $$("selector") function take a root node to
search?
Ex: $$("selector", $(formID)) would only iterate over elements in the
form.
The only other route that I have come across is optimizing the function
with Sylvain Zimmer's method, available here:
http://www.sylvainzimmer.com/index.php/archives/2006/06/25/speeding-up-prototypes-selector/
Thanks in advance for any help you can offer.
Mike Kelp
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---