Questions within pages that require scripting operate slightly different than a regular question. If you have two or more questions within a page and you need to apply a script to one of the questions, you will need to consider either to apply the script on the page or on that specific question. If you are using On Load, On Validate or On Exit scripts, you will need to place it on the page. On the other hand, JavaScript and Style scripts should be placed on the specific question within the page.
In this scenario, you will need to read through the script article to determine what type of script you will be using. In each script article, the instructions will indicate where the script will be placed. The options are: On Load, On Validate, On Exit, JavaScript or Style. Please refer to the detailed instructions below that adheres to the script your require.
Example
You have two questions, Q1 and Q2, appearing in the same page and you want to do the following:
- Apply an On Load script to hide an option in Q1.
- Apply a JavaScript to hide the day and month of the Date Question in Q2.
Detailed Steps
On Load, On Validate, or On Exit Scripts:
- Open the page where the question resides.
- Click Edit Scripts.
- Enter the script to the appropriate tab.
For Example #1, place the script to hide an option in Q1 on the On Load tab. - Click Save.
JavaScript and Style Scripts:
- Open the question.
- Click Edit Scripts.
- Enter the script to the appropriate tab.
For Example #2, place the script to hide the day and month of the Date Question in Q2 on the JavaScript tab. - Click Save.
Note: If you move an existing question which uses On Load, On Validate and On Exit scripts into a page, these scripts will be automatically moved to the page scripts.
More Information
Read the following WebHelp topics to learn more:
Comments
0 comments
Article is closed for comments.