Topic: need idea for multiple help windows made simple

lo there all,

i am building a site with some rather long, and long winded forms. What i would like to do is provide a little help link that could possibly open a help popup window, or provide help in a large enough tool-tip, even cooler, an ajax tag that could give a paragraph or so to help someone know how to fill out that particular entry.

i don't want to write 20 or 30 rhtml files.

Does anyone have a cool idea, a function to put somewhere that i could just pass the text of the help file ?

thanks

Re: need idea for multiple help windows made simple

You could do all this with Javascript (include Prototype):

<a href="#" onclick="Element.update('help_for_field', '...'); return false;">help</a>
<div id="help_for_field"></div>

Clicking the help link should update the div with the inserted text (I think). You will probably need to customize it a bit. You can even move this into a helper method to make it really easy.

Railscasts - Free Ruby on Rails Screencasts

Re: need idea for multiple help windows made simple

this is cool, is there something i can put in the <div> to make it go away again ?

Re: need idea for multiple help windows made simple

Actually there's a better way to do this:

<a href="#" onclick="Element.toggle('help_text'); return false;">help</a>
<div id="help_text" style="display: none">help text...</div>

This should hide/show the element when clicking the help link.

Railscasts - Free Ruby on Rails Screencasts

Re: need idea for multiple help windows made simple

wow, perfect. thanks so much
this is really cool looking.