We've implemented a data collection survey that has several sections: shallow/deep, fresh/salt. This means that certain sites will skip questions depending on the site. The questions are grouped by block, and we use javascript to fill in unused responses and skip the unused blocks. For example, a shallow site will not be shown the deep questions.
At the end of the survey, we present a summary of the entered and automatically filled in data for the user to compare to the postcard that was filled out during sampling and testing. There is a yes/no question that asks if the postcard and the screen data match. When the user clicks 'No', the next button is disabled and clicking the previous button uses javascript to jump through all the blocks back to the starting block of the questions.
This all works until we put in a timing question. Now the javascript will not automatically jump over an unused block. It will fill in the null responses correctly. Manually clicking the previous button brings the user to the previous page as it should. Unused blocks are not automatically skipped, and the user must click next to proceed.
Any thoughts on why $('NextButton').click(); or $('PreviousButton').click(); stops working with the timing question?
Page 1 / 1
Try deferring the Next button click until the stack clears:
```
setTimeout(function() { jQuery("#NextButton").click(); },0);
```
Also, make sure your script is in addOnReady and not addOnload, and make sure page transition is set to None.
```
setTimeout(function() { jQuery("#NextButton").click(); },0);
```
Also, make sure your script is in addOnReady and not addOnload, and make sure page transition is set to None.
Many thanks @TomG. Never would have guessed this. Getting the survey to jump back to the start was the easy part.
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.