How to Create a Lightbox Form

March 26, 2024

A lightbox form is a window that pops up when visitors click on a link. It’s an easy way to share your forms with visitors. When the lightbox opens, it will overlay the page containing the link. The lightbox will look like this:

How to Create a Lightbox Form Image-1
Youtube Embed Poster: KABFPsul6xw

Getting the Embed Codes for Lightbox

Please follow the steps below to get started:

  1. Open your form in the Form Builder and click the Publish tab.
  2. Click Embed on the left navigation menu.
  3. Choose, and click the Lightbox option.
How to Create a Lightbox Form Image-2
  1. On the next page, you may copy the code by clicking the green Copy Code button. Or, hit the Preview button to see how it looks.
How to Create a Lightbox Form Image-3

Customizing the Lightbox

If you want to customize the look and feel of the lightbox, click the Customize button as shown in the above screenshot. In the customization section, you have options to change the lightbox title, form dimensions, styles, colors, and an option to open on page load or not.

How to Create a Lightbox Form Image-4

Please don’t forget to click the Save Changes button, then copy the generated code.

Customizing the Call-To-Action to Use an Image

If you want to use an image instead of a button/link to trigger the lightbox to open, you have to replace the following line:

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

…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 same thing for the {imageURL}, you should also change it with the actual image URL. Please note that the class attribute’s value is very important for the lightbox to work when your visitor clicks the image.

Do you have any questions, suggestions, or feedback? Please post a comment below or create a Jotform Support ticket.

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: https://www.jotform.com/answers/

Contact Jotform Support: https://www.jotform.com/contact/

Send Comment:

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

Comments:

  • Mudebo Ramazani - Profile picture
  • CASK Gene Foundation - Profile picture
  • Cheikh IDA DIOP - Profile picture
  • Barry Ho - Profile picture
  • Kevin Kubota - Profile picture
  • Eddison ong - Profile picture