Script: Mobile Smart Don't Know Auto Submits Page

This article will help you add code to Mobile Smart Grids when using a Don't Know


Background

There are some instances in which you will be trying to program a survey in a manner that will help mobile respondents have a good survey taking experience. If you have a Mobile Smart Grid with an overall Don't Know option, when taking the survey on mobile you cycle through each row of your grid one at a time but if you select the opt-out the first time, you should skip the entire grid. In order to get this behavior to work, you will need to add the code below to your grid. 


Instructions

  1. Program your Mobile Smart Grid
  2. Add the following code to the 'ADD JAVASCRIPT' field
    • See article: Adding JavaScript and/or CSS to a Question
      /* AUTO SUBMIT NEXT PAGE WHEN USING MOBILE SMART GRID WITH A DONT KNOW */
      jQuery(".cm-grid-dontknow input[type='checkbox']").change(function() {
      if (this.checked) {
      
      jQuery('#cm-NextButton').click(); /* copy and paste this line in for as many rows as you have. if you have 10 rows, you need 10 of these */ 
      jQuery('#cm-NextButton').click();
      
      }
      });
      		
  3. A few things to note about this code:
    • This code assumes you only have the one grid on a page with no other questions on the same page
    • Your rows are not filtered. This means that all rows of your grid will be seen by all. 
    • You will need to add the line in the code with the note to copy and paste, one for each row of your grid
      • Example: if your grid has 10 rows, you will need that code pasted in 10 times
  4. Make sure to test on your desktop as well as a mobile device to ensure its working as needed
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.