Check out the LimeSurvey source code on GitHub!

numeric limits based on previous answer

More
5 years 7 months ago #62998 by shinsthm
I'm wondering is there any way to make limitations for the numeric answers based on previous answer?

for example in question 1 the user answered 10, in the next question I don't want him to input numbers larger than 10.

Thanks in advance!
shin

Please Log in to join the conversation.

More
5 years 7 months ago #63047 by tpartner
You would need to use JavaScript. The details of the script would depend on question types and whether everything was on the same page or multiple pages.

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: shinsthm

Please Log in to join the conversation.

More
5 years 7 months ago #63049 by shinsthm
Thanks Tony!
In my case the difficult is that the questions are generated dynamically: it will appear in some branches if certain conditions are fufilled.

for example, if Q1>10, show Q2; if Q2>5, show Q3; I need to limit answer of Q3<answer of Q2; answer of Q2< answer of Q1...

Please Log in to join the conversation.

More
5 years 7 months ago #63051 by tpartner
You can put JavaScript validators on questions hidden by JavaScript. If the question is hidden, nothing happens, otherwise the validator kicks in.

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: shinsthm

Please Log in to join the conversation.

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