User Guide

Adding parameters in Lightbox and Feedback forms

Last Update: April 10, 2012

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="//www.jotform.com/min/g=feedback" type="text/javascript">
new JotformFeedback({
formId: "xxxxxxxxxxx",
buttonText: "rating",
base: "http://www.jotform.com/",
iframeParameters: {
     'test1': 'value1'
},
background:'#F59202',
fontColor:'#FFFFFF',
buttonSide: "bottom",
buttonAlign: "right",
type:false,
width: 700,height: 500});
</script>

To explain, 'test1' is the name of the field.  So you will need to open the source code from your browser and find the name of the field you wish to be prepopulated.  Normally the name of the field in JotForm is 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="//www.jotform.com/min/g=feedback" type="text/javascript">
new JotformFeedback({
formId: "xxxxxxxxxxx",
buttonText: "rating",
base: "http://www.jotform.com/",
iframeParameters: {
     'test1':  variable1
},
background:'#F59202',
fontColor:'#FFFFFF',
buttonSide: "bottom",
buttonAlign: "right",
type:false,
width: 700,height: 500});
</script>

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

14 Comments...

  • josuel

    como criar um formulário que o usuário colocar o anúncio com visualização no site direto cem precisar de usar e-mail desde já
    obrigado

  • surajwebworld

    This is really nice web site

  • xcitemedia

    Just what I needed! Thank you.

  • clicksem

    what if we need to define more than one variable?

  • bruynzeel

    Doesn't work for me. No url shows up in the email. Form is located on www.bruynzeel-storage.nl

  • pixonti

    So the steps for this seems to work when the script is sourced with http://www.jotform.com/min/g=feedback, but not when sourced with http://www.jotform.com/min/g=feedback2. I'm guessing this is a new version of the script, but does not support the iframeparameters.

  • nikaiachurch

    I am trying to add a parameter but doesn't seem to work

    My form

    new JotformFeedback({
    formId:'#############',
    base:'http://jotformeu.com/',
    windowTitle:'Επικοινωνία',
    iframeParameters: {
    'q6_test': 'value1'
    },
    background:'#FFA500',
    fontColor:'#FFFFFF',
    type:false,
    height:500,
    width:700
    });


    My form element


  • nikaiachurch

    sorry the form element didn't show

    input type="text" class="form-textbox" id="input_6" name="q6_test" size="20"

  • nikaiachurch

    By using the above and with a little php I populated a hidden field on my form with the page URL. This way I know for which article I receive the feedback.

    PHP Function to get the page url:
    function curPageURL() {
    $pageURL = 'http';
    // if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
    $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
    } else {
    $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
    }
    return $pageURL;
    }

    Put it in a variable:
    $curURL = curPageURL();

    Paste a little jscript:
    echo('var myUrl="' . $curURL . '";');

    Add the form populating the hidden field "url" with the page url:


    new JotformFeedback({
    formId:'#########',
    base:'http://jotformeu.com/',
    windowTitle:'Επικοινωνία',
    iframeParameters: {
    'url': myUrl
    },
    background:'#FFA500',
    fontColor:'#FFFFFF',
    type:false,
    height:500,
    width:700
    });

    The src for the form has to be feedback and not feedback2 src="http://jotformeu.com/min/g=feedback"

  • zkl john

    What parameter i should use if i don't want close button in this feedvback.

  • Hema

    Hello!!! Welcome to the web world!!

  • Stefanooo

    I tried to combine the lightbox with adding a parameter. But could not tell why I remain unable to get the combination going. Both solutions work well if run separately. Could I ask you for your support? http://www.make-mobile.de/webportal/landing/converison-jotform.html

  • Stefanooo

    ps: the issue I am facing is the lightbox not opening

  • pavelgon

    I use a lightbox and fill in the data with iframeParameters. But this does not work well for me with "Continue forms latter - Enaeble". My data is being overwritten. How to make my data priority.

Send Comment