How to Create a Lightbox Form

January 13, 2022

A lightbox form is a window that pops up when a visitor clicks on a link. It overlays the page containing the link and looks something like this:


It’s an elegant and easy way to share your forms with visitors. Follow the steps below to get started:

  1. Go to your Form Builder and click the Publish tab.
  2. Click Embed on the left nav then click Lightbox.
  1. On the next page, you may copy the code as is by clicking the green Copy Code button.

Or, hit the Preview button to see how it looks like.

Customizing the Lightbox

If you want to further customize the look and feel of the lightbox, click the Customize button.


On the customization section, you have options to change the lightbox title, form dimensions, style, colors, and an option to open on page load or not.


Don’t forget to click the Save Changes button to do just that, then copy the generated code.

Customizing the Call-To-Action to Use an Image

Replace the following line:

<a class="btn lightbox-{formID}" style="margin-top: 16px">

…with the following:

<img src="{imageURL}" class="btn lightbox-{formID}">

You need to replace {formID} with your actual Form ID. It is the string of numbers at the end of the form URL.


The class attribute’s value is very important for the lightbox to work when the image is clicked. The {imageURL} should also be replaced with the actual image URL.


You’re done! How did it go? Were the instructions clear enough? How can we improve them? Please share your comments in the section below.

Was this guide helpful?
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum:

Contact Jotform Support:

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.