Embed: Passing Parameters in LIghtBox

  • lzarling
    Asked on April 9, 2018 at 10:45 PM

    Hello,

    I have a single page with multiple links.
    When you click these links, we want a JotForm Ligbtbox form to open up. (a single form)
    We want to pass values from these links that are clicked into hidden fields on the form. (so we know what link is clicked - we have two unique values for each link).


    I've researched the support section of JotForm and found lots of discussions about passing paramters into lightboxed forms, but I've not been able to find a clear working example or workflow. Further, wondering if this would require custom JS/JQ to pass a variable of a link that is clicked as a parameter into a single jotform, on a page with 30+ links.

    How can we do this?


    Thanks,

  • gizem
    Replied on April 10, 2018 at 3:44 AM

    1- Firstly, copy lightbox code of your form as seen below: 

    1523345625Screen Shot 2018 04 10 at 10 Screenshot 10


    2- Then, add iframeParameters as seen:

    iframeParameters: {

         'fieldsUniqueName': 'value'

    },

    - You need to pass the unique name of the field which you want to prefill. You can find a fields unique name from the properties of the field:

    1523346017Screen Shot 2018 04 10 at 10 Screenshot 21

    This guide will help you: Adding parameters in Lightbox and Feedback forms

    I hope it helps.

  • lzarling
    Replied on April 10, 2018 at 3:09 PM

    Thanks for your reply!
    I'm looking to pass parameters dynamically when a link is clicked.
    The paramters are based on data attributes of the link clicked.

    I've found several threads going back a few years on here, but no specific examples of how this has been done.

    I think we would have to use JS/JQ to get the data attributes as a variable and inject that into the IFrameParameters. Is this correct?

  • Mike
    Replied on April 10, 2018 at 3:50 PM

    With the Pop-Up embed links, we can pass the URL parameters like this:

    Embed: Passing Parameters in LIghtBox Image 1 Screenshot 20

    Unfortunately, we cannot do the same with the Lightbox links. In theory, it might be possible with some custom JS code.