User Tools

Site Tools

Translations of this page?:

en:template:checkbox

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Checkbox fields ====== **Checkbox** fields are useful when an information on the card is a choice between Yes or No. A _Checkbox_ is created. A default choice defines if the Checkbox is checked or not, and the user can change it to modify the value on the card. <code javascript> "fields": [ { "name": "trueornot", "label": "True ?", "type" : "checkbox", "default": true } ] </code> To set a field to the **Checkbox** type, set the ''type'' property to ''checkbox''. The ''default'' property can then be set to ''true'' or ''false'' (and not anymore to a text value). ===== Using the variable ===== Inside the canvas, some properties are set to a boolean (for example, ''visible''). Set such a field to the text value ''"?trueornot"'' (using your field name), and it will be converted to the boolean value corresponding to the state of the checkbox. Useful to hide / show a field on a card. ==== Not ==== What if you need to get the inverse result of the checkbox ? Then, you can add the code ''?!variable'' to get the inverse result. If your checkbox ''variable'' is checked, it will return ''false''.

en/template/checkbox.1498122627.txt.gz · Last modified: 2017/06/22 11:10 by Nicolas Ronvel