rails 3, easiest way to implement 'popup help' for form fields -


Using the haml for our Rail 3 app (but not the compass or anything like this):

When our user forms If we fill in, we want to do simple search for each field to apply a 'popup' box that explains what's included in it. Should be fancy, but arbitrarily large multi-line popup boxes with 20 to 100 words should be allowed

'Popup' is used to "open" or "wide" any kind, but one True pop-up-the-page will be ideal.

Can anyone recommend an easy way to implement it?

The simplest way I can think of is to insert a link inside your input field label Using a hidden device indicates your help with the information:

  & lt; Label = "name" & gt; Name: & lt; A href = "# name-help" rel = "facebox" & gt; & Lt; / A & gt; & Lt; / Labels & gt; & Lt; Input type = "text" name = "name" ... /> & Lt; Div id = "name-help" style = "display: none;" & Gt; & Lt; P & gt; This & lt; Strong & gt; Name & lt; / Strong> & Lt; / P & gt; There is help text for; & Lt; P & gt; You can enter any HTML here & lt; / P & gt; & Lt; / Div & gt;   

You can insert support devices after the inputs, or at the end of the document; They will not make any difference.

Comments