This script and instructions will enable you to automatically trigger the Next button and proceed to the next page after a specified number of seconds.
Common uses might be to allow a participant to view an image or concept but limit the amount of time they have to view it. The participant must have scripting switched on in their browser for this to work (this is the default for the vast majority of users). It is most likely this will be applied on a Text Instruction screen, but it may be used on any question.
Notes:
- If it is used on a question rather than a Text Instruction it will trigger an error message unless the question has Question Completion Required unchecked under Properties.
- The Script does not work with the mobile view because of the use of JavaScript.
- To function properly, the script requires JavaScript to be enabled on the browser.
Detailed Steps
- Create a Text Instruction and populate it with the necessary text and/or pictures.
- Copy the script below into Notepad or any other text editor (e.g. Notepad++, Textpad).
- Replace TIME with the number of milliseconds you want the system to wait before moving to the next page.
- Insert the completed script into the Script section of the Text Instruction by doing the following:
- Select the Text Instruction in the Questionnaire Tree.
- In the Scripting section of your question, click Edit Scripts.
- Paste the script into the JavaScript tab.
- Click Save and close the Script Editor.
- Click Validate and test your survey.
Script
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js "
type="text/javascript">
/*
Script Name: How do I automatically skip to the next page after a specified time period?
To ensure your script works as expected, always copy the original script from the script library found in the support portal. Failure to use the most up to date script from the script library may cause unexpected results.
*/
</script>
<SCRIPT src="https://static.visioncritical.net/prog/s1/js/common/common_v1.560.js ">
</SCRIPT>
<script> var delay = TIME; //specify how long you want to hide the next button in ms (1 second = 1000 ms)
function autoAdvance(time){
disableAndHideNextButton();
setTimeout("enable_Element('NextButton');click_Element('NextButton');",time); }
$j(document).ready(function(){
autoAdvance(delay); });
</script>
More Information
For more information, please read this Web help article on Text instruction.
Comments
0 comments
Article is closed for comments.