1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 14:54:51 +00:00
TiddlyWiki5/editions/tw5.com/tiddlers/widgets/CheckboxWidget (field Mode).tid
yaisog bfcb386343
Restructure and optimize CheckboxWidget docs (#7362)
* Restructure and optimize `CheckboxWidget` docs

* Minor improvements

* Use new tab macros and some reformatting

* Fix bug in widget-attr-link tooltip

* Minor layout tweaks

* First try at a Widget Documentation Style Guide

* Add new tabs-related macros to overview

* Update CSS, add tm-scroll and rename macros

* Avoid RSoE with tm-scroll, improve CSS for tab-links

* Handle doc-tab-links within tab tiddlers better

* Reflect macro name changes in their docs

* Update Widget Doc Style Guide
2023-04-04 18:00:04 +01:00

16 lines
1.1 KiB
Plaintext

caption: <<.attr field>>
created: 20230314171223911
description: tab
modified: 20230317161110431
tags: CheckboxWidget
title: CheckboxWidget (field Mode)
!!<<.link "<<.attr field>> Mode" "CheckboxWidget (field Mode)">>
Using the checkbox widget in field mode requires the <<.attr field>> attribute to specify the name of the field. The <<.attr checked>> and <<.attr unchecked>> attributes specify the values to be assigned to the field to correspond to its checked and unchecked states respectively. The <<.attr default>> attribute is used as a fallback value if the field is missing or contains a value that does not correspond to the value of the <<.attr checked>> or <<.attr unchecked>> attributes.
This example creates a checkbox that is checked if the field <<.field status>> is equal to <<.value open>> and unchecked if the field is equal to <<.value closed>>. If the field value is undefined then it defaults to <<.value closed>>.
<<wikitext-example-without-html """<$checkbox field="status" checked="open" unchecked="closed" default="closed"> Is it open?</$checkbox>
''status:'' {{!!status}}""">>