Difference between revisions of "Show a text grid and a single question in the same page"
Line 1: | Line 1: | ||
− | + | == Challenge == | |
− | |||
− | == 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 | ||
Line 9: | Line 7: | ||
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. | 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) | + | (This is quite similar to question of Open type) |
− | Example: | + | Example: |
− | When there is no checkbox checked, the text boxes in the grid are enabled so that we can enter the texts. | + | 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]] | + | [[Image:QuestionTips TextGrid Enabled.jpg]] |
− | When a checkbox is checked, the textboxes are disabled. | + | When a checkbox is checked, the textboxes are disabled. |
− | [[Image:QuestionTips TextGrid Disabled.jpg]] | + | [[Image:QuestionTips TextGrid Disabled.jpg]] |
− | == Solution == | + | == Solution == |
− | *Create 2 questions: TextGrid and Single | + | *Create 2 questions: TextGrid and Single |
− | *Single is set as a dummy question | + | *Single is set as a dummy question |
− | *Add javascript to TextGrid to include Single's HTML to the question's HTML | + | *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 | + | *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 | + | *Check if there is an option selected or no textbox is left empty when clicking Next |
− | *Load the saved value when loading the question | + | *Load the saved value when loading the question |
*Save the value entered to the two questions | *Save the value entered to the two questions |
Revision as of 08:41, 18 December 2008
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