How to Create a Form Inside a Lightbox in Drupal 7
Let’s say you would like to display a form inside a lightbox of Drupal 7. In that case, you can create the link which consists rel=”lightbox” and displays HTML content. Here is an easy way how to do this.
First step is to enable forms as a block. To do this, login to Drupal admin area and navigate to content management to select the created form. Then click on “Webform” tab and follow to “Form Settings”. Finally click on “Enable as a block” to apply the changes.
Insert the form in the particular place where lightbox is located. This can be either header, main area or footer.
Set the CSS style for a specific area where the form was inserted as a block to “display: none;”. This is something we should do by editing CSS style files and adding required line in the specific line which defines the style for this form.
Then navigate “Configuration”, “Media”, “Lightbox” and click on “Advanced Settings” in order to enable “Enable Lightbox inline”.
Insert the following HTML code in order to insert the form in the lightbox:
That is about it. In some cases it might also be possible to do this by customizing template files, however, described method might be more suitable as it does not require any coding knowledge