Difference between revisions of "Show a text grid and a single question in the same page"

From Catglobe Wiki
Jump to: navigation, search
Line 9: Line 9:
 
(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.  
Line 28: Line 28:
 
*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
 +
 +
== Code ==

Revision as of 08:43, 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.

QuestionTips TextGrid Enabled.jpg 

When a checkbox is checked, the textboxes are disabled.

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

Code