Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
metadata:
title: Checkboxes with code
short title: Checkboxes
documentation: "https://docassemble.org/docs/fields.html#fields checkboxes"
example start: 1
example end: 2
---
question: |
Please tell me what you think.
fields:
- "Select the fruits you like": likes_fruit
datatype: checkboxes
code: |
[
{'apple': 'Apples'},
{'peach': 'Peaches'},
{'pear': 'Pears'}
]
- "What is your favorite fruit overall?": favorite_fruit
---
question: |
Thank you for your thoughts.
subquestion: |
% if likes_fruit['apple']:
You like apples.
% endif
% if likes_fruit['peach']:
You like peaches.
% endif
% if likes_fruit['pear']:
You like pears.
% endif
Your favorite, though, is ${ favorite_fruit }.
mandatory: True