-
Notifications
You must be signed in to change notification settings - Fork 300
Expand file tree
/
Copy pathchoices-from-code.yml
More file actions
39 lines (39 loc) · 995 Bytes
/
choices-from-code.yml
File metadata and controls
39 lines (39 loc) · 995 Bytes
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
metadata:
title: Radio buttons from code
documentation: "https://docassemble.org/docs/fields.html#field with choices"
---
question: |
What type of shoes do you wear?
field: target_variable
choices:
code: |
[{'sneakers': "Sneakers",
'help': "Comfortable shoes.",
'css class': "sneakers",
'color': "secondary"},
{'sandals': "Sandals",
'help': "For summer.",
'css class': "sandals",
'color': "danger"},
{'clogs': "Clogs",
'help': "For hippies.",
'css class': "clogs",
'color': "warning"},
{'crocs': "Crocs",
'help': "For teenagers",
'show if': not is_adult,
'css class': "crocs",
'color': "warning"},
{'other': "Other",
'default': True,
'help': "Because the other types suck.",
'css class': "othershoe",
'color': "success"}]
---
question: Result of question
subquestion: |
target_variable is: "${ target_variable }"
mandatory: True
---
code: |
is_adult = True