Difference between revisions of "Show a text grid and a single question in the same page"
Line 1: | Line 1: | ||
− | = Show a text grid and a single question in the same page = | + | = Show a text grid and a single question in the same page = |
+ | |||
+ | == Challenge == | ||
In order to allow the respondent to skip a text grid question | In order to allow the respondent to skip a text grid question | ||
− | As a questionnaire creator | + | As a questionnaire creator |
+ | |||
+ | I want to show several options at the end of a text grid question, on which the respondents can click to skip the text grid question. | ||
+ | |||
+ | (This is quite similar to question of Open type) | ||
+ | |||
+ | Example: | ||
+ | |||
+ | When there is no checkbox checked, the text boxes in the grid are enabled so that we can enter the texts. | ||
+ | |||
+ | [[Image:QuestionTips TextGrid Enabled.jpg]] | ||
+ | |||
+ | When a checkbox is checked, the textboxes are disabled. | ||
− | + | [[Image:QuestionTips TextGrid Disabled.jpg]] | |
− | + | == Solution == | |
− | + | *Create 2 questions: TextGrid and Single | |
+ | *Single is set as a dummy question | ||
+ | *Add javascript to TextGrid to include Single's HTML to the question's HTML | ||
+ | *Make sure when clicking a checkbox, other checkboxes are unchecked and the textboxes are disabled | ||
+ | *Check if there is an option selected or no textbox is left empty when clicking Next | ||
+ | *Load the saved value when loading the question | ||
+ | *Save the value entered to the two questions |
Revision as of 08:40, 18 December 2008
Show a text grid and a single question in the same page
Challenge
In order to allow the respondent to skip a text grid question
As a questionnaire creator
I want to show several options at the end of a text grid question, on which the respondents can click to skip the text grid question.
(This is quite similar to question of Open type)
Example:
When there is no checkbox checked, the text boxes in the grid are enabled so that we can enter the texts.
When a checkbox is checked, the textboxes are disabled.
Solution
- Create 2 questions: TextGrid and Single
- Single is set as a dummy question
- Add javascript to TextGrid to include Single's HTML to the question's HTML
- Make sure when clicking a checkbox, other checkboxes are unchecked and the textboxes are disabled
- Check if there is an option selected or no textbox is left empty when clicking Next
- Load the saved value when loading the question
- Save the value entered to the two questions