Implemention of "Click on an icon and show a hidden div"

I checked the prototypehelper and find the method show

show(*ids)

Shows hidden DOM elements with the given ids.

but I 'm not sure how to integrate these.

Should I have a function and a corresponding rjs to do this?

or I can just do it in the original rhtml?

THX

You can use the PrototypeHelper functions straight from your web page
(e.g. from an onclick event handler) or you can make call Prototype
functions directly… it is just a JavaScript library, after all. For
complete details on using Prototype directly check out http://
www.prototypejs.org. RJS comes into play, for example, when the
request needs to go through the server from an AJAX call.

-Bill

On Feb 7, 9:18 am, Bontina C. [email protected]

Bill S. wrote:

You can use the PrototypeHelper functions straight from your web page
(e.g. from an onclick event handler) or you can make call Prototype
functions directly… it is just a JavaScript library, after all. For
complete details on using Prototype directly check out http://
www.prototypejs.org. RJS comes into play, for example, when the
request needs to go through the server from an AJAX call.

-Bill

On Feb 7, 9:18 am, Bontina C. [email protected]

I’m testing

foo
show foo

but the foo just won’t show up.

Try this:

<%= link_to(‘show foo’, ‘#’, :onclick => “Element.show(‘foo’); return
false;”) %>

And make sure the page is loading the Prototype javascript in the
header.

HTH,
Kevin S.

Using Firefox with the Firebug extension can really help debug these
kind of problems.

On Feb 7, 9:58 am, Bontina C. [email protected]