We use cookies to improve our services and provide a better experience. By continuing to use this site, you agree with our Cookies Policy.

Tutorials
More than 400 step-by-step articles to guide you through online project development.
HomeTutorialsCMS TutorialsDrupal

How to Create a Form Inside a Lightbox in Drupal 7

Brazil VPS

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.

Follow These Steps to Create a Form Inside a Lightbox

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:

1
<a href="?width=310&height=460&inline=true#block-name">"

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

Linux KVM Hosting
Rate this Tutorial:
No Comments Leave a Comment
Leave a Comment

Other (195)

Popular Keywords