How do I get a form element to display in a lightbox? I'm currently using Drupal 7 and I'm using the Form API to generate the form.  What I'd like is for certain fields to be represented by a link, which when clicked on, opens the field in some kind of lightbox.  This is what I tried, but it doesn't seem to work:

  $form['snvisdt_note']=array(
  '#prefix' =&gt; "&lt;a href=\"/screen #snvisdt_note_div\" rel=\"lightmodal\" title=\"Add Note\" &gt;note\&lt;/a&gt; &lt;div id=\"snvisdt_note_div\" style=\"display:none;\"&gt;",
  '#type' =&gt; 'textarea',
  '#title' =&gt; 'Add More Information',
  '#suffix' =&gt; "&lt;/div&gt;",
  );


"screen" is the name of the page the form is on.  I am trying to do this in Lightbox 2, but would be happy to use some other solution, if it works.  Can someone please give me an example of what would work?
If you want to display form element into popup, then I would suggest you to use ctools api. It will provide you functionality to create a custom popup to render content.


  Ctools provide Modal dialog functionality to display element in modal.


You need to follow below step for the same:


Create a custom module and create Menu item which will interact with ctools modal.
Define ajax callback for the menu item and return HTML of the modal
using ajax.

You can check working example  (http://deeson-online.co.uk/labs/insert-form-pop-modal-ctools-and-drupal-7)