Welcome, Guest
Username: Password: Remember me

TOPIC: numeric limits based on previous answer

numeric limits based on previous answer 3 years 3 months ago #62998

  • shinsthm
  • shinsthm's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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
The administrator has disabled public write access.

Re: numeric limits based on previous answer 3 years 3 months ago #63047

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4263
  • Thank you received: 801
  • Karma: 367
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: shinsthm

Re: numeric limits based on previous answer 3 years 3 months ago #63049

  • shinsthm
  • shinsthm's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 2
  • Karma: 0
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...
The administrator has disabled public write access.

Re: numeric limits based on previous answer 3 years 3 months ago #63051

  • tpartner
  • tpartner's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 4263
  • Thank you received: 801
  • Karma: 367
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: shinsthm
Moderators: ITEd
Time to create page: 0.104 seconds
Donation Image