On Aug 24, 4:17 pm, Roy Pardee <[email protected]> wrote:
> Nobody has advice for me on this? :(
>
you basically need to write some raw javascript for this ( if
('something'.innerHTML == ..)) and either mash that together with the
rjs stuff using << or just write the whole thing in javascript and
forget about the rjs bits
Fred
> On Aug 20, 2:45 pm, Roy Pardee <[email protected]> wrote:
>
>
>
> > Hey All,
>
> > I'm dabbling in a little DHTML to show/hide a fieldset on a page, w/
> > the following:
>
> > <%=
> > link_to_function("Show People", nil, :id => "more_link") do |page|
> > page.visual_effect(:toggle_appear, "organization-people")
> > page.replace_html("more_link", "Hide People")
> > end
> > %>
>
> > This works very nicely, except for one thing--when the page loads, the
> > link attached to the resulting jscript function is "Show People". The
> > first time I click it changes to "Hide People" & the fieldset appears--
> > all very nice. My problem is that I don't know how to change the link
> > text back to "Show People" once the user clicks a second time. The
> > link always *does* what I want--showing or hiding as appropriate, but
> > it only *says* what I want for the first two clicks.
>
> > Is there a way to find out what the current link contains so I can
> > make that call to replace_html conditional?
>
> > Many thanks!
>
> > -Roy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---