Welcome to the LimeSurvey Community Forum

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

Default value for Array(number) question (dropdown select input)

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 2 weeks ago #229196 by LISHANGQI
Please help us help you and fill where relevant:
Your LimeSurvey version: [3.28}
Own server or LimeSurvey hosting: Own
Survey theme/template: fruity
==================
Dear experts,

I'd like to set the default value for an Array(number) question with select-input. And I just found a solution for text-input :https://forums.limesurvey.org/forum/design-issues/104922-default-value-in-a-array-numbers-type-question. May I ask if it's possible to also set it for a select-input Array(number) question? If it wouldn't take too much time, would you please help me to modify this script if possible?

Thanks a lot in advance!

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 2 weeks ago - 3 years 2 weeks ago #229198 by Joffm
Hi,
the post you mention is 5 years old and refers to version 2.50.

But Denis' post there is still valid.

Set the values by an equation

Add an Equation question type at start of your survey and set the value (if it's empty) for each of your sub questions

{QCODE_SQ001_SQ001=if(is_empty(QCODE_SQ001_SQ001.NAOK),"4",QCODE_SQ001_SQ001.NAOK)}
{QCODE_SQ001_SQ002=if(is_empty(QCODE_SQ001_SQ002.NAOK),"52",QCODE_SQ001_SQ002.NAOK)}

 

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 2 weeks ago by Joffm.

Please Log in to join the conversation.

  • LISHANGQI
  • LISHANGQI's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
3 years 1 week ago #229300 by LISHANGQI
Thanks a lot, joffm, as I have 6 array questions like this and each has 25cells of questions, I prefer to use the js solutions if possible. Anyway, the codes from tpartner still work for 3.28, so I may change my questions to the text input style to use it.:)

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose