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
- Add your 'Radio Question' as needed
- See article: Standard Question: Radio items (Single Select)
- Add the following code to the 'Add JavaScript' field
- See article: Adding Javascript and/or CSS to a Question
- Add the code below:
/* 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(); } }); });
- Make sure to test thoroughly