Adding Parameters in Lightbox and Feedback Forms

September 15, 2021

In an instance that you need to submit variables in Lightbox or Feedback forms, here’s what you have to do:

You need to insert iframeParameters: { } property inside JotformFeedback({ }).

Example:


<script src="https://form.jotform.com/static/feedback2.js"type="text/javascript">
    new JotformFeedback({
        formId:"xxxxxxxxxxxxxxx",
        buttonText:"Feedback",
        base:"https://form.jotform.com/",
        type:false,
        iframeParameters: {
            'test1':'value1'
        },
        background:"#F59202",
        fontColor:"#FFFFFF",
        buttonSide:"left",
        buttonAlign:"center",
        width:700,
        height:500,
        isCardForm:false
    });
</script>

To explain, ‘test1’ is the unique name of the field. You can also open the source code from your browser to find the name of the field you wish to be pre-populated. Normally the name of the field in Jotform has a prefix something like ‘q3_’ or something else.

If you want the value to be a variable, you should remove the single quotes and declare the value as a variable.

Example:

<script type="text/javascript">
    var variable1 ="value1";
</script>
<script src="https://form.jotform.com/static/feedback2.js"type="text/javascript">
    new JotformFeedback({
        formId:"xxxxxxxxxxxxxxx",
        buttonText:"Feedback",
        base:"https://form.jotform.com/",
        type:false,
        iframeParameters: {
            'test1': variable1
        },
        background:"#F59202",
        fontColor:"#FFFFFF",
        buttonSide:"left",
        buttonAlign:"center",
        width:700,
        height:500,
        isCardForm:false
    });
</script>

In this example you will get on your test1 text field a prepopulated value of “value1”.

Was this guide helpful?
Contact Support:

Our customer support team is available 24/7 and our average response time is between one to two hours.
Our team can be contacted via:

Support Forum: https://www.jotform.com/answers/

Contact Jotform Support: https://www.jotform.com/contact/

Send Comment:

Jotform Avatar
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Comments: