Forum: Ruby on Rails RJS question - Query DOM/CSS from RJS?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Dave V. (Guest)
on 2006-04-22 18:30
(Received via mailing list)
I understand that I wouldn't be able to directly query into the
DOM/CSS of a page from within an RJS file because it runs on the
server but is there any way to populate a variable from the controller
or something to gain access to DOM information?

What I want to do is this:

I have some RJS to blind_down an error message panel, but if the form
is resubmitted and there are still errors, the blind_down still plays
from the beginning because the RJS just says to blind_down with no
conditions. I would like to be able to query the visibility of the
error div to determine if I should blind_down or just leave it visible
and replace the content.

Is there any way to do this?
This topic is locked and can not be replied to.