Check out the LimeSurvey source code on GitHub!

Set answer of a hidden question

More
5 years 6 months ago - 5 years 6 months ago #62794 by madopr
Sorry, I have another question: Is there a way to set the answer of an "always hidden" question with a javascript workaround so that that answer is stored in the database? I tried with this:
$('#answer72611X130X1907').val('ASDF');

but the answer of this question is stored as NULL
Last Edit: 5 years 6 months ago by madopr.

Please Log in to join the conversation.

More
5 years 6 months ago #62805 by tpartner
You can't manipulate questions with JavaScript if they are hidden with the advanced question setting. You need to hide the question with CSS or JavaScript.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
5 years 6 months ago - 5 years 6 months ago #62808 by greg_d
Tony,

In the past also needed to save answers into hidden question and I managed to do so thanks to this post: www.limesurvey.org/forum/design-issues/4...esults?lang=en#47302

and setting $deletenonvalues = 0;

Was it save? Can be any side effect of changing this parameter?
Last Edit: 5 years 6 months ago by greg_d.

Please Log in to join the conversation.

More
5 years 6 months ago #62817 by tpartner
You only need to change that param if you're using conditions to hide the questions. I recomend using CSS or JavaScript to hide the question so you don't need to worry about config settings.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form