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"


11 Comments...


   
josuel (May 28, 2011 at 08:36 PM)

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

View Answer


   
surajwebworld (June 30, 2011 at 07:22 AM)

This is really nice web site


   
xcitemedia (August 25, 2011 at 11:46 AM)

Just what I needed! Thank you.


   
clicksem (April 07, 2012 at 10:51 AM)

what if we need to define more than one variable?

View Answer


   
bruynzeel (November 02, 2012 at 11:22 AM)

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

View Answer


   
pixonti (November 25, 2012 at 03:56 PM)

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.

View Answer


   
nikaiachurch (February 05, 2013 at 08:02 AM)

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


View Answer


   
nikaiachurch (February 05, 2013 at 08:03 AM)

sorry the form element didn't show

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


   
nikaiachurch (February 06, 2013 at 11:05 AM)

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 (March 17, 2014 at 11:04 AM)

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

View Answer


   
Hema (February 08, 2016 at 03:55 AM)

Hello!!! Welcome to the web world!!


Send Comment