Have an idea?

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

4 Select questions with combo boxes on one page - can they be dependent on each other?

Hi,

I have 4 select questions on one page with combo boxes which drop down from the same list of prices. I want it such that the first box is the lowest price and the second box is the next lowest price, the third the second highest and the fourth the highest. Is there a piece of code that I can use to validate this so that if this isn't the case an error comes up and the respondent can't proceed? I don't want respondents to be able to have the price of q2 be less than q1 etc.  

Such that always the values are always q1<q2<q3<q4  

It seems that this might be easy to achieve but I don't know how to code it?

Any help would be great!
asked Jun 29, 2017 by Jasha Bowe Bronze (1,680 points)
retagged Jun 29, 2017 by Walter Williams

1 Answer

+2 votes
 
Best answer
You can do this by adding custom JavaScript verification to q2, q3, and q4 verifying that each value is greater than the previous.  For example, q2 can be given this verification:

if (SSI_GetValue('q2') < SSI_GetValue('q1')) {
    strErrorMessage = 'The second price cannot be greater than the first price';
}


Note that you may need to switch "<" with ">" depending on if your list goes from lowest to highest or from highest to lowest.
answered Jun 29, 2017 by Zachary Platinum Sawtooth Software, Inc. (67,650 points)
selected Jun 29, 2017 by Jasha Bowe
...