Welcome, Guest
Username: Password: Remember me

TOPIC: Set answer of a hidden question

Set answer of a hidden question 3 years 3 months ago #62794

  • madopr
  • madopr's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 26
  • Karma: 0
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: 3 years 3 months ago by madopr.
The administrator has disabled public write access.

Re: Set answer of a hidden question 3 years 3 months ago #62805

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Re: Set answer of a hidden question 3 years 3 months ago #62808

  • greg_d
  • greg_d's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 47
  • Thank you received: 7
  • Karma: 4
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: 3 years 3 months ago by greg_d.
The administrator has disabled public write access.

Re: Set answer of a hidden question 3 years 3 months ago #62817

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4264
  • Thank you received: 801
  • Karma: 368
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.117 seconds
Donation Image