How do I load lightbox as soon as someone visits the website?

  • Profile Image
    Answered on May 31, 2011 at 11:12 AM

    Hello Jentoronto,

    There is a way for your form to pop-up once the page loads up.  The only difficult part is figuring out how to make it load depending on if the visitor has already filled up the form or not, unless you are planning to use PHP coding with authentication or something that will tell that the user is logged in, you do not need to show up the form.

    Here's the sample code for making your feedback form script pop-up once the page is visited:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="" lang="en" xml:lang="en">
        <title>Contact Us</title>
    <body onload="document.getElementById('lightbox-11493338180').click()">
    <script src="//" type="text/javascript">
    new JotformFeedback({
    windowTitle:'Contact us',
    <input id="lightbox-11493338180" style="display:none" type="submit" value="lightbox" > </body>

    I have highlighted the important parts that you should take note of:

    1. The onload event property inside the body tag
    2. I have changed the anchor tag (<a id=...>) to an input tag.  This way, the onload event will be able to mimick the click of the mouse on an input tag.

    As for your show-only-once-per-user option, this is quite difficult to accomplish as you will need to validate the user via authentication before you could put up a condition to show the form or not.  Another option is to use cookies but this situation is quite different as this will show the form once only from one computer browser instead of one visitor.

    If you would like to consider the cookie based option, just let me know.


  • Profile Image
    Answered on May 31, 2011 at 07:06 PM


  • Profile Image
    Answered on May 31, 2011 at 07:56 PM


    That is because you have another feedback form embedded in your site. Go find the other feedback code and delete it.

    That should fix it.


  • Profile Image
    Answered on May 31, 2011 at 07:57 PM

    Yup, fixed. Thanks so much!

  • Profile Image
    Answered on April 05, 2012 at 12:35 PM

    Hi I just implemented the pop up lightbox with thanks to your information above. I would however really appreciate your Cookie Based Solution to avoid it popping up every single time the user visits the site

  • Profile Image
    Answered on July 03, 2012 at 07:40 AM

    i tried with this but came like this can any body solve this


  • Profile Image
    Answered on July 03, 2012 at 07:45 AM

    Hello, anudeep.  Can you try again to give us the link to the screenshot?  The image did not appear properly from your post.