Can I use multiple links to show a lightbox form?

  • Hgna
    Asked on February 7, 2015 at 7:41 PM

    Hi,

     

    I would like to have links to the same subscribe form in two locations on the same page:

     

    One link in a clickable image, the other link in the text.

     

    However, as I click, the subscribe form pops up (I use lightbox) twice, one overlaying the other.

     

    The overlaying form is actually empty. Closing it reveals the fillable form underneath.

     

    Is there any way I can avoid the form opening twice upon clicking image/text-link?

     

    Thanks so much for any help with this.

     

    You can see it happening by clicking the subscribe image (second image on the page) here:

     

    http://localnepaltoday.com/?page_id=4242

     

    Cheers,

    Hans 

  • raul
    Replied on February 7, 2015 at 9:00 PM

    The reason of why this is happening is because you've added the lightbox script on your page 3 times in different sections, I assume that you added the whole code of the lightbox script on every link or image that you wanted to use to show the form. 

    You need to add the script part of the lightbox only one time in your page:

    <script src="https://secure.jotform.com/static/feedback2.js?3.2.5272" type="text/javascript">
      var JFL_50194000670342 = new JotformFeedback({
        formId:'50194000670342',
        base:'https://secure.jotform.com/',
        windowTitle:'Subscribe to page',
        background:'#FFA500',
        fontColor:'#FFFFFF',
        type:false,
        height:500,
        width:700,
        openOnLoad:false
      });
    </script>

    And use the anchor tag on every link/image you want to use to display the lightbox form

    <a class="lightbox-50194000670342" style="cursor:pointer;color:blue;text-decoration:underline;">Local politics</a>

    Let us know if this helps.
    Thank you.