Have an idea?

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

Require response for either numeric or select question on the same page

I have two numeric questions 'C5bDays' and 'C5bWeeks' and one select question C5bselect (radio button)

I want to require a response for either the select question or one of the numeric questions, and have an error message appear if the respondent answers both the select question and one/both of the numeric questions . And another error message if the select question and both numeric questions are left blank
asked Nov 29, 2018 by anonymous

1 Answer

0 votes
This could be achieved by appending this to yesterday's custom JavaScript verification:

if (($('#c5bDays').val().trim() || $('#c5bWeeks').val().trim()) && SSI_GetValue('c5bSelect')) {
    strErrorMessage = 'Error message here.';

I'm not sure I would recommend this, though.  By default, select questions with radio buttons don't have any way to undo an answer - once a respondent answers the select question, they won't be able to undo that click in order to answer one of the numeric fields.
answered Nov 29, 2018 by Zachary Platinum Sawtooth Software, Inc. (205,575 points)
I cant get this to work. When I test the survey and click the next button, nothing happens. It wont even go to the next page. Any idea why?
Do any error messages appear in your browser's console when you open / submit the page?