Script: Answering a Radio Question Submits the Next Page Button

Answering a 'Radio Question' can auto submit the 'Next Page' button


Background

You may want to auto submit the 'Next Page' button when you answer. This article will show you how to set this up.


Instructions

Step 1: 'Radio' Question
  1. Add your 'Radio Question' as needed
    1. See article: Standard Question: Radio items (Single Select)
  2. Add the following code to the 'Add JavaScript' field 
    1. See article: Adding Javascript and/or CSS to a Question
    2. Add the code below:
    3. /* NOTE: ANSWER A RADIO QUESTION AND SUBMIT NEXT PAGE BUTTON */ 
        jQuery(function()
        {
          /* NOTE: REPLACE "Q4" WITH THE RADIO QUESTION NUMBER */ 
          jQuery(".cm-question[data-qnum=Q4] input:radio").change(function()
          { 
            /* NOTE: ADD/UPDATE THE FORMULA IN THE NEXT LINE BELOW WHICH WILL SHOW THE FOLLOW-UP */
            if (jQuery(".cm-question[data-qnum=Q4] input:radio:checked").attr("data-name") >= "1")
            {
              jQuery("#cm-NextButton").click();
            }
          });
        });
      		
  3. Make sure to test thoroughly
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.