Welcome to the LimeSurvey Community Forum

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

Check and show that values add up to 100 in an Array (numbers) question

  • marco_biffino
  • marco_biffino's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
3 days 17 hours ago #265485 by marco_biffino
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.68
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: default
==================


Hi, I've an Array (numbers) question and I would like to check if the inserted values sum up to 100 or, at least, show the sum below the input boxes.

I've found here a couple of post that suggest me that it is possible and quite simple with a script ( Multiple Numerical Input + Checkbox , Mandatory and Multiple Numerical Inputs (Sum Up To 100%) Or Alternatively A Radio Button ) but my knowledge of javascript is very limited and I can figure out how to do it.

Thank you all in advance

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 days 17 hours ago - 3 days 17 hours ago #265486 by DenisChenu
You can just add this to Question validation equation
{sum(self.NAOK) == 100}

and to Tip for whole question validation equation
"Current sum are {sum(self.NAOK)}"

Else : just for information : forum helpers NEVER import an LSQ, only LSS. Because we don't create a survey, add a group and hope you use same language than us.
 

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Last edit: 3 days 17 hours ago by DenisChenu.

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose