List Info

Thread: Change Button Text - Ajax




Change Button Text - Ajax
user name
2006-08-14 22:36:52
John Lynch wrote:
> Hi,
> I have the following code
> <%= button_to_function "Hide",
"Element.toggle('mytext');"%>
> 
> which does toggle the invisiblity of the text just
fine, But want I want 
> via ajax magic, is to also toggle the button text, so
it will now 
> display "Show" when I have toggled the
invisiblity of the Div.
> 
> Thanks for any help.
> 
> John

See the example above for one way of doing it - this has
nothing to do
with AJAX though; its just simple javascript.

-- 
Posted via http://www.ruby-forum.com
/.
_______________________________________________
Rails mailing list
Railslists.rubyonrails.org
h
ttp://lists.rubyonrails.org/mailman/listinfo/rails
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )