Difference between revisions of "Questionnaire - Javascript Fun Tips"
Line 12: | Line 12: | ||
*questioncheck: the function that will be called before going Next | *questioncheck: the function that will be called before going Next | ||
− | ==== quest ==== | + | ==== quest ==== |
− | There are many properties added to quest object. | + | There are many properties added to quest object. |
− | quest.setQuestions(Array subQuestions) | + | quest.setQuestions(Array subQuestions) |
− | quest.setOptions | + | quest.setOptions(Array options) |
+ | |||
+ | quest.setAnswer(string value) | ||
+ | |||
+ | ques.getHTML | ||
+ | |||
+ | quest.onInit | ||
+ | |||
+ | quest.questions | ||
+ | |||
+ | quest.options | ||
==== questioncheck ==== | ==== questioncheck ==== |
Revision as of 11:25, 18 December 2008
Basic Hints
Questionnaire viewer is implemented in a way that you can add javascript to manipulate the way your questions are displayed.
jQuery is already included in the viewer, thanks to what javascript has even more powerful effect! (read more about jquery here: http://jquery.com/)
Javascript is a property on both question and questionnaire levels, which means that you can add javascript for each question or for the whole questionnaire.
The most important features are:
- quest: the current question's object
- questioncheck: the function that will be called before going Next
quest
There are many properties added to quest object.
quest.setQuestions(Array subQuestions)
quest.setOptions(Array options)
quest.setAnswer(string value)
ques.getHTML
quest.onInit
quest.questions
quest.options
questioncheck
Examples
Hide sub question text column in a grid question
Show a text grid question and a single question in the same page
Add an extra column before an answer option column in single grid question
Change stylesheet of an answer option column in a single grid question