Permalink
Cannot retrieve contributors at this time
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?
docassemble/docassemble_base/docassemble/base/data/questions/examples/fields-checkboxes-code.yml
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34 lines (34 sloc)
780 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |