-
Notifications
You must be signed in to change notification settings - Fork 306
Expand file tree
/
Copy pathjsshowif.yml
More file actions
94 lines (91 loc) · 2.23 KB
/
Copy pathjsshowif.yml
File metadata and controls
94 lines (91 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
metadata:
title: Show fields with JavaScript
short title: JS Show
documentation: "https://docassemble.org/docs/fields.html#js show if"
example start: 1
example end: 4
---
question: |
Please fill in the following information.
subquestion: |
Try setting "Favorite fruit" to
"apple" or "mango" (and unfocus the
field) to see what happens.
fields:
- Favorite fruit: fruit
- Favorite vegetable: vegetable
- Favorite fungus: mushroom
js show if: |
val("fruit") == "apple"
- Favorite spice: spice
js hide if: |
val("fruit") == "mango"
---
question: |
Please fill in the following information.
subquestion: |
See what happens when you set
"Favorite cuisine" to "Chinese food."
fields:
- Favorite cuisine: cuisine
choices:
- Chinese food
- French food
- Belgian food
- Favorite dish: dish
js show if: |
val('cuisine') == "Chinese food"
---
question: |
Please fill in the following information.
fields:
- "Do you watch TV?": watches_tv
datatype: yesnoradio
- Favorite TV show: tv_show
js show if: |
val('watches_tv') == true
- "I listen to the radio": listens_to_radio
datatype: yesno
- Favorite radio station: radio_station
js show if: |
val('listens_to_radio') == true
- Favorite modulation type: favorite_modulation
datatype: radio
choices:
- FM
- AM
js show if: |
val('listens_to_radio') == true
- Favorite antenna style: favorite_antenna
js show if: |
val('favorite_modulation') == 'FM'
---
question: |
Please fill in the following information.
subquestion: |
Try selecting Apple and Plum.
fields:
- Select the fruits you like: liked_fruits
datatype: checkboxes
choices:
- Apple
- Peach
- Pear
- Plum
- Favorite way to eat apples and plums: apple_plum_dish
js show if: |
val("liked_fruits['Apple']") && val("liked_fruits['Plum']")
---
question: |
Thank you for that information.
subquestion: |
You like ${ fruit },
${ cuisine }.
% if watches_tv:
Your favorite TV show is ${ tv_show }.
% endif
% if listens_to_radio:
Your favorite radio station is ${ radio_station }.
% endif
You like ${ liked_fruits.true_values() }.
mandatory: True