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

    I need to limit the light box to once per browser session

    Asked by Malletsme on February 02, 2017 at 08:07 PM

    Hi,

    I created a light box form. YAY! I read your article on how to delay it opening for a time. I chose 30 seconds. I've also ready your article on how to use cookies to limit the light box to once per browser session. I can't get the two to mix. I need help please :).

    I've pasted my code here so that you can see what I've done. I need to know how to limit this light box to once per browser session.

     <script src="https://form.jotform.com/static/feedback2.js?3.3.REV" type="text/javascript"> var JFL_70316619337154 = new JotformFeedback({ formId: '70316619337154', base: 'https://form.jotform.com/', windowTitle: 'HCB Pop Up', background: '#FFA500', fontColor: '#FFFFFF', type: '2', height: 500, width: 700, openOnLoad: false }); </script> <a id="lightboxdelay" class="btn lightbox-70316619337154" style="margin-top: 16px;display:none;"> HCB Pop Up </a>

    <script language="JavaScript">

    var delayseconds = 30;

        function pause() {

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

        }

       function whatToDo() {

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

        }

    window.onload = pause;

    </script>

     

    Thanks so much!

    John

    Page URL:
    www.happycamperbookkeeping.com

  • Profile Image
    JotForm Support

    Answered by jonathan on February 02, 2017 at 11:12 PM

    Hi John,

    Were you able to actually make the once per browser session code work?

    I could not see it working when checked on your website page.

    Please clarify first if the solution using the guide did work on your test page already.

    --

    I also recommend reviewing this discussion thread about the same feature.

    On that discussion, our colleague Charlie have a working test page here.

    Hope this help. Let us know how we can be of further assistance.