How to set value for a hidden question by javascript
Revision as of 04:06, 22 November 2018 by Administrator (talk | contribs) (Created page with "Category:Questionnaire I have an "Age" question, with type number like this: File:2018-11-19_16-17-00.png Then I want to convert these number into some groups of ag...")
I have an "Age" question, with type number like this:
Then I want to convert these number into some groups of age, such as:
- Under 40
- [40-49]
- [50-59]
- [60-69]
- 70 and Over
How to do by javascript?
- First, create a single question "D_AgeGroup" right after "Age" question, with such options:
- Second, create a page question type multiple questions per page:
- And then add "Age", "D_AgeGroup" to that multi page:
- After that, at "Age" question, go to CSS tab to hide "D_AgeGroup"
- Finally, also at "Age" question go to Javascript tab, write script for setting value of "D_AgeGroup" from "Age"
You are done.
Viewer only show question of Age. When inputing value on Age question, the approriate value will also set to D_AgeGroup: