Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Is it possible to pass the URL fields into the URL of an iframe in survey?

More
6 years 7 months ago #158675 by Qsgt
Hi,

I have an iframe in the middle of one of my surveys that uses data collected at an earlier point in the survey (specifically Name and SAVEDID). I know that I can pass this data to an external script through URL fields in the end URL but can I can I pass the data into the URL of an iframe that appears part way through the survey?

Thanks in advance,
qsgt
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #158676 by tpartner
Yes, you should be able to use the same placholders in the src attribute of the iframe tag. (assuming you have a <iframe src="xx"/> tag somewhere in the question text)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
6 years 7 months ago #158685 by Qsgt
I tried using this as my iframe src " form.jotform.co/63137860302854?name [first]={name_first}&name[last]={name_last}&registrationNumber={SAVEDID}"

But it didn't work because the curly braces got percent encoded in the URL without replacing the variable names.

Should I be doing something differently?

qsgt
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #158722 by tpartner
I don't know how the braces would be encoded. Where did you place that URL and what LS version are you using?

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #158732 by DenisChenu
And what is this jotform ? Else : for url : it's more easy to do the url in an Equation question type.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 7 months ago #158789 by tpartner
Yes, as Denis suggests, it may be easier to define the URL in a hidden (by question class) equation type question and reference that in your <iframe> tag.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
5 years 11 months ago - 5 years 11 months ago #168560 by b1994mi
Hi, I have a similar question. I have no experience in PHP programing, so every answer that I googled have different approach and neither that have implementation on Limesurvey.

What I am trying to do is to have a question that a user can pick drop down menu for an answer, then every time the user selects, the iframe google maps changes too. This is just to give the user extra clear explanation in what sub-district that he/she lives.

This is what the question would look like:


This is the code:
Code:
<p><iframe frameborder="0" height="500" scrolling="no" src="https://www.google.com/maps/embed/v1/place?q=kebayoran+baru&amp;amp;key=AIzaSyBFw0Qbyq9zTFTd-tUY6dZWTgaQzuU17R8" width="500"></iframe></p>
 
<p> </p>
 
<p>Where do you live?</p>

I would like to have the q=kebayoran+baru to be dynamic according to the drop down menu answer/selection.

Any ideas?
Last edit: 5 years 11 months ago by b1994mi.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose