Auto open the lightbox form after 15 seconds

  • trainings24x7
    Asked on November 30, 2015 at 8:17 AM

    2. I want to make my form auto and open after 15 seconds.

     

    3. I also want to close this form, once it auto appears (for those)

     

    See the following code regarding this i have used in the website (header.php) wordpress

     

    <script src="https://form.jotform.me/static/feedback2.js?3.3.REV" type="text/javascript">
    var parentWidth = window.innerWidth;

        if(window.innerWidth <= 499) {parentWidth = window.innerWidth;} else {parentWidth =  500;}
    var JFL_53300890979464 = new JotformFeedback({ formId: '53300890979464', base:

    'https://form.jotform.me/', windowTitle: 'HELP? Contact Us', background: '#FFA500', fontColor:

    '#FFFFFF', type: 'false', height: 500, width: parentWidth, openOnLoad: true }); </script>

    <a id="lightboxdelay" class="btn lightbox-53300890979464" style="margin-top: 16px display:none;">

    Help? Contact Us </a>

    <script language="JavaScript">
    var delayseconds = 15;
        function pause() {
        myTimer = setTimeout('whatToDo()', delayseconds * 1000)
        }
       function whatToDo() {
    document.getElementById('lightboxdelay').click();
        }
    window.onload = pause;
    </script>

     

    Still form opens as website opens, delayseconds is not working

  • Welvin Support Team Lead
    Replied on November 30, 2015 at 8:58 AM

    Please use the following lightbox scripts instead: http://pastiebin.com/565c55b300064

    This is working to my end. Here's an example page: https://shots.jotform.com/welvin/html/lightbox-delay.html.

    Please let us know if you need any further assistance implementing this.

  • trainings24x7
    Replied on December 2, 2015 at 1:19 AM

    Please let me know that - I have wordpress website and where i can use this code. In header.php or somewhere else??

  • trainings24x7
    Replied on December 2, 2015 at 1:33 AM

    Thanks Welvin,

     

    Now code is working in my wordpress.

  • Jan
    Replied on December 2, 2015 at 5:10 AM

    Glad to hear that your issue is now resolved. On behalf of Welvin, you're welcome. Let us know if you need further help. Thank you.

  • nishant
    Replied on December 4, 2015 at 11:32 PM

    Thanks Jan,

    But can i ask here one more question -

    What if i want my lightbox form on visibile for desktop. not for mobile, tablet and etc. Is there any wany to do it??

     

    Thanks,

    Nishant

  • Welvin Support Team Lead
    Replied on December 5, 2015 at 3:47 AM

    The lightbox should be visible in the desktop. But I think you mean how to adjust the width of the lightbox form when viewed using a desktop. Is this correct? I will try to check this further and then let you know.

  • trainings24x7
    Replied on December 5, 2015 at 4:04 AM

    Yes.

  • Welvin Support Team Lead
    Replied on December 5, 2015 at 5:23 AM

    Thank you for the confirmation. I will let you know here once I have the correct codes for auto width adjustments.