Welcome to the LimeSurvey Community Forum

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

Prefilling question text based on a hidden question

  • krosser
  • krosser's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
5 years 3 months ago - 5 years 3 months ago #177714 by krosser
Hi guys!

I'd like to prefill a question text with data/numbers from a previous hidden question so that only I and not participants would be able to enter that data in text fields of the array. I need to include some numbers into the survey that are pulled into question text based on the answer from the first question.
I know how to prefill/tailor answers from previous questions, which are answered by participants, but how do you do it when you want to prefill or change certain words in text by yourself, depending on what has been selected/answered in previous questions?

For example,
-- the participant chooses an option from the first question.
-- Then the option is pre-linked with some text/data from an Array-Text in the next hidden question. I will prefill that table with JS code.
-- Then that text/data is shown in a number of following questions in placeholder fields {}, depending on what option is chosen in the first question.


I'm attacheing a test survey.

File Attachment:

File Name: limesurvey...1864.lss
File Size:22 KB


Many thanks in advance for your suggestions. :)

I'm using the latest LS 3.22 hosted on LS servers, not installed locally.
Last edit: 5 years 3 months ago by krosser. Reason: formatting
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 3 months ago #177722 by tpartner
If you load a hidden (by CSS) question via JavaScript, you will need to fire Expression Manager to see that value in piping/tailoring. The way to do that varies for different question types but, for example, with a text input it may be as simple as adding .trigger('change') to the jQuery chain.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: krosser
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose