This script enables you to flip standard Single or Multi Choice Grids.
Note:
- This script works only on standard Grid questions, not visual.
- This script works only if participants have Javascript enabled on their browsers.
Example
Before without the script
The option list is too long and the grid is going out of the screen to the right.
After
The option list is now aligned vertically so it's easier for respondents to scroll and read down.
Detailed Steps
- Copy the script below into Notepad or any other text editor (e.g. Notepad++, Textpad).
- Change Q_GRID to the name of the question.
- If you want to repeat headers, change -1 to the number of rows you wish to repeat after. Otherwise, leave it as is.
e.g. Changing it to 6 will repeat the header every 6 rows throughout the grid. - Insert the completed script into the Script section of the question by doing the following:
- Select the grid question in the Questionnaire Tree.
- In the Scripting section of the page, click Edit Scripts.
- Paste the script into the JavaScript tab.
- Click Save.
- Click Validate and test your survey.
Script
<SCRIPT src="https://static.visioncritical.net/prog/s1/js/common/common_v1.561.js"> /* Script Name: How do I flip the rows and columns in a standard grid question? 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>flipGrid([%(Q_GRID.Id)%], -1);</SCRIPT> <style> .ResponseGridHeaderTd, .ResponseGridTd, .ResponseGridTdAlternate{ width: 18% !important; } .EmptyColumnTd, .ResponseGridTdLabelCol, .ResponseGridTdLabelColAlternate{ text-align: left; width: 250px !important; } .ResponseGridHeaderTd { text-align: center; } </style>
Comments
0 comments
Article is closed for comments.