Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
v:2.0:checkout [2021/05/12 13:33] – [Maintaining custom field values] adam | v:2.0:checkout [2023/07/19 13:02] (current) – [A Dropdown Example] adam | ||
---|---|---|---|
Line 105: | Line 105: | ||
{% endfor %} | {% endfor %} | ||
</ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== A Radio Inputs Example ==== | ||
+ | This example uses a similar approach as above, using a line of twig code at the top to set the values of the radio buttons as an array: | ||
+ | < | ||
+ | |||
+ | This array sets out what options are present in the radio inputs - setting both the value for the input (" | ||
+ | |||
+ | <code html> | ||
+ | {% set options = {" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <div class=" | ||
+ | <label class=" | ||
+ | Delivery Day (required) | ||
+ | </ | ||
+ | <div class=" | ||
+ | < | ||
+ | {% for option, label in options %} | ||
+ | <div class=" | ||
+ | <label class=" | ||
+ | {{ label }}</ | ||
+ | </ | ||
+ | {% endfor %} | ||
</ | </ | ||
</ | </ |