The scripts discussed in this document enable the following functionality:
Hiding the Next button
Note: The script to hide the Next button is only available for non-visual (flat) question types.
- Hide the Next button (permanently)
- Hide the Next button (permanently but auto-page to the next page after a specific period of time)
- Hide the Next button (temporarily and show the button after a specific period of time)
Disabling the Next button
- Disable(grey out) the Next button (permanently)
- Disable(grey out) the Next button (temporarily and enable the button after a specific period of time)
Renaming the Next button
- Rename the Next button
- Rename the Next button & close the window if the button is clicked (no Firefox support)
Important
- These scripts does not work with mobile view because of the use of JavaScript.
- To function properly, all scripts in this document require JavaScript to be enabled on the browser.
- Some scripts require minimum edits.
Detailed Steps
Add the question
These scripts work with any question type or page of the survey.
- Click the Questionnaire tab of your survey.
- Add a question.
Prepare the scripts
If the script requires editing, we recommend that you prepare your script in a Text Editor such as Notepad before pasting it.
- Create a new file in Notepad or similar text editor.
- Copy and paste the appropriate script from below into the text editor.
- Follow the instructions and edit the script.
Insert the code
- Right-click on the question and select Edit scripts...
- In the script editor pop-up, click on the JavaScript tab.
- Copy and paste the code.
- Click Save and close the script editor pop-up.
- Validate the survey.
Scripts:
I. Hiding the Next button Script
1. Hide the Next button (permanently)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript"> /* Script Name: How do I hide, disable, or rename the next button? 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> $j(document).ready(function(){ disableAndHideNextButton(); }); </script>
2. Hide the "Next" button (permanently but auto-page to the next page after a specific period of time)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the time in milliseconds (1 second = 1000 ms) by when it will jump to the next page*/
var time = 2000;
$j(document).ready(function(){
disableAndHideNextButton();
setTimeout("click_Element('NextButton')", time);
});
</script>
3. Hide the "Next" button (temporarily and show the button after a specific period of time)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the time in milliseconds (1 second = 1000 ms) by when it will jump to the next page*/
var time = 2000;
$j(document).ready(function(){
disableAndHideNextButton();
setTimeout("enableAndShowNextButton()", time);
});
</script>
II. Disabling the Next button
1. Disable (grey out) the ‘Next’ button (permanently)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript"> /* Script Name: How do I hide, disable, or rename the next button? 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> $j(document).ready(function(){ disable_Element('NextButton'); }); </script>
2. Disable(grey out) the ‘Next’ button (temporarily and enable the button after a specific period of time)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the time in milliseconds (1 second = 1000 ms) that the Next button will remain disabled*/
var time = 2000;
$j(document).ready(function(){
disable_Element('NextButton');
setTimeout("enable_Element('NextButton')", time);
});
</script>
III. Renaming the Next button
1. Rename the "Next" button
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the new title for the Next button*/
var new_title = 'I am a button';
$j(document).ready(function(){
rename_NextButton(new_title);
});
</script>
2. Rename the "Next" button for multi-language survey
Note: Provided that the language is installed on your IC and the translation is complete on your survey, please duplicate the yellow highlighted line of code and replace language code and the text. Specific language codes can be looked up here.
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the new title for the Next button*/
var new_title = 'I am a button';
if("[%Culture%]"=="fr-CA") new_title = “Je suis un bouton”;
$j(document).ready(function(){
rename_NextButton(new_title);
});
</script>
3. Rename the Next button & close window if the button is clicked (no Firefox support)
<SCRIPT src="https://static.visioncritical.net/prog/ext_libs/jquery/jquery-1.12.3.min.js" type="text/javascript">
/*
Script Name: How do I hide, disable, or rename the next button?
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>
/*specify the new title for the Next button*/
var new_title = 'CLOSE WINDOW';
$j(document).ready(function(){
rename_NextButton(new_title);
$j("#NextButton").click(function(){
self.open('', '_self');
self.close();
});
});
</script>
Comments
0 comments
Article is closed for comments.