What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Showing our form in a LightBox Pop-Up

    Asked by RevelDesign on March 23, 2016 at 03:04 PM

    Hello, I was wondering if you could help me with my form code?

    <!-- Pop-Up -->

    <script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript"> var JFL_60825776348164 = new JotformFeedback({ formId: '60825776348164', base: 'https://form.jotform.com/', windowTitle: 'Domain, Hosting, and Email', background: '#060606', fontColor: '#FFFFFF', type: '1', height: 500, width: 700

    });</script>

    <a id="lightboxdelay" class="lightbox-21357249698871" style="cursor:pointer;color:blue;text-decoration:underline;">United URL</a>

    <script language="JavaScript">

     

    var delayseconds = 5;

     

        function pause() {

     

        myTimer = setTimeout('whatToDo()', delayseconds * 1000)

     

        }

     

       function whatToDo() {

     

    document.getElementById('lightboxdelay').click();

     

        }

     

    window.onload = pause;

     

    </script>

    <!-- End Pop-Up -->

     

     

     

    I can't seem to get it to work no matter how i change it. If the code is correct do i need to add a js fuction to force script onload? Any advise would be awesome. Thank you!

    Page URL:
    http://www.unitedurl.com

    JotForm domain popup lightbox pop up delay
  • Profile Image

    Answered by Ben on March 23, 2016 at 03:58 PM

    I would just like to make sure that we are on the same page first, if you do not mind. Could you please confirm to us if you want to use the lightbox popup code, but to have it open up as soon as the page is loaded?

    Based on the code this is the form that is in question:

    http://www.jotform.us/form/60825776348164

    Based on the code it seems that you wish to have it started after 1 second upon page load, but the trick with onload is that if any script uses that it will overwrite the old onload function, but as I have mentioned, I would like to confirm that were are on the same page about the issue first and then we will help you set it all up :)

  • Profile Image

    Answered by RevelDesign on March 23, 2016 at 05:59 PM

    what i would like is for the popup to be delayed on page load like say after a few seconds. however the code which i implemented from this post 

    http://www.jotform.com/answers/6753-Does-the-pop-up-or-light-box-option-allow-you-to-set-a-delay-for-the-pop-up-Say-have-it-pop-up-after-2-minutes-vs-immediately-#5

     

    is not working for me. The above pasted, in my original request is the exact code i have included in my header. This does nothing, however i don't see any error in syntax.

    I have toyed with my own .js and have gotten no errors, but i can not seem to get it to open. I know if i set the lightbox to customize open onload it will do so, but when i try to give it a time delay i can not seem to get it to function.

     

    Thank you for you help!

      

  • Profile Image
    JotForm Support

    Answered by jonathan on March 23, 2016 at 06:33 PM

    Please refer to this user guide instead

    How-to-Auto-popup-a-Lightbox-Form

    You can view the source code on the demo page on how it was done also.

    Hope this help. Let us know if you need further assistance.

     

     

  • Profile Image
    JotForm Support

    Answered by jonathan on March 23, 2016 at 06:37 PM

    I just realize the demo page was not working as intended.

    I modified and recreated it here https://shots.jotform.com/jonathan/webtest/Autopop-Lightbox.html

    Please try this one. Let us know how it goes.

  • Profile Image

    Answered by RevelDesign on March 24, 2016 at 04:39 PM

    Thank you sincerely for your help!