Can I use multiple links to show a lightbox form?

  • Profile Image
    Hgna
    Asked on February 07, 2015 at 07: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 

  • Profile Image
    raul
    Answered on February 07, 2015 at 09: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.