question skip in case of single answer

0

Hello everyone, 

I am trying to build a sequence of questions piping from one to the other and I cannot fix the following situation:

The first question is a question with multiple answer (which of the following brands you use on a regular basis?). Then, I need to answer another question piping the answers from the previous one (which of the brands regularly used, you use most often? – single answer). Thus, if at the first question I have a single answer, I would like to skip the second one, which makes no sense – how can I do that?

 

Thank you for a prompt reply.

All the best.

Patrick McCabe answered
    0

    This solution works for most situations.  It assumes two things.

    1. You have the ability to add a JavaScript action with your SurveyGizmo account
    2. That the radio button question is on its own page with no other questions

    Add the following code in a JavaScript action on the page that has the radio button question.  The code counts the number of options displayed and if there’s only one option displayed, it selects that option automatically and presses the Next button automatically.  If it counts more than one option being displayed, the script does nothing and allows the respondent to answer the question.

    $(function checkOptionCount() {
      var question = $(“.sg-question-set”).find(“.sg-question”),
      options = question.find(“.sg-list”);

      // Autoselect/submit if only one option is visible
      if (options.length === 1) {
      options.find(‘.sg-input-radio’).click();
      $(‘.sg-next-button’).click();
      }
    });

    This will also work if the follow-up question happens to be a checkbox question type with the following modification.  CHANGE…

    options.find(‘.sg-input-radio’).click();

    TO

    options.find(‘.sg-input-checkbox’).click();

     

    And I’m sure it will work with other question types but I haven’t tried it out on other question types.  Good luck!

     

    Patrick McCabe answered
      ×

      Login

      Question stats

      • Active
      • Views1051 times
      • Answers1 answer
      • Followers1 follower