Welcome to the LimeSurvey Community Forum

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

use value from a hidden question (text) in the same group

  • suselko
  • suselko's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
More
3 years 7 months ago #204394 by suselko
Hi folks,
The context to my question is this: I am preparing a multilingual survey and want the first page that respondents see to show country flags, with translated text 'Tap/click on the flag' next to each flag. Upon clicking one of the flags the respondent is taken to the survey in their mother tongue (which technically speaking is a different LimeSurvey survey than the one with the flags).
I have designed that initial one-page survey with flags with no problem. However, I wanted to make it a bit more sophisticated and tailor the text 'Tap/click on the flag' to whether they are doing the survey on a touch-screen device (in which case I want the text to be 'Tap on the flag') or a computer (in which case I want the text to be 'Click on the flag').
To that end, I have employed Joffm's solution ( forums.limesurvey.org/forum/design-issue...obile-device?start=0 ) that identifies whether the respondent is using a mobile phone or not. This information is stored in an initial 'long text' question that is hidden via Javascript.
My problem is this: when this is followed by a 'text display' question that shows the country flags (and that has an if statement referring to the value of that initial question), it seems that LimeSurvey cannot use the value from that initial question in the if statement. See the first attachment.
What confuses me is that a similar survey that I found on LS forum (second attachment) works.
I am using LS 3.23.0.
Any ideas will be much appreciated!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #204395 by Joffm

What confuses me is that a similar survey that I found on LS forum (second attachment) works.

Why is it confusing? In the text display it is explained hy there is a text display and why there are two groups.

You see the javascript starts working when the whole page is displayed
$(document).ready(function()
So the language question is on the screen already.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • suselko
  • suselko's Avatar Topic Author
  • Away
  • Junior Member
  • Junior Member
More
3 years 7 months ago #204397 by suselko
Thanks Joffm. It's clearer now - I thought that Javascript starts working when a given question is being processed.
I have employed a workaround: the question with flags+text is in the second group, but the flags also show at the end of the first group, just without any text. That first screen with flags is auto-advanced by JS. So the respondent sees just the flags for a split of a second, and then the tailored text appears next to the flags.
Attached in case anyone found it of use.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose