Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

How can I not let the respondents type in a smaller value?

Hi, I have the following questions:

Z19v What's your personal income?
- Income [Open Answer]
- Do not want to say

Z20v What's your household income?
-Income [Open Answer]
-Do not want to say

I don't want to let people say that they have a smaller household income than their personal income.

I made Z19v and Z20v selected question type, but now I don't know how to validate they answers and not let them to fill in any value for the income.

Can you help me please? Should I change the question type?
asked Jul 29 by anonymous

2 Answers

0 votes
Create both question as Numeric. For Refuse, create Single select question on same page, remove require response and apply scripts (1. both Income and refuse not allow. 2. Require minimum one answer).

please copy below in the custom javascript verification of the second question:

var check=[% Z19v %]; /* Change Z19v with the first numeric question */

if(check>=1 && SSI_GetValue("[% QuestionName() %]")<check)
{
    strErrorMessage="Error text...";
}
answered Jul 29 by Rahul Mittal Bronze (4,980 points)
edited Jul 29 by Rahul Mittal
Thank you very much for this!
Do you know any specific scripts for not allowing checking both income and refuse and also for require minimum one answer?

Right now I can check both income and refuse and also I can move to the next question without selecting anything at this question.

But the validation is working, thank you!
0 votes
You may find the Not Applicable: Per Question option from the question library will suit your needs.  If you select the checkbox it will gray out the other response option so they can only do one or the other.

https://sawtoothsoftware.com/resources/question-library/not-applicable-per-question
answered Jul 30 by Jay Rutherford Gold (36,195 points)
...