Checkbox Element Element

Home | Getting Started | API | Elements | Actions | Validators | Handlers | Configuration Options | Advanced Guides | Troubleshooting | About

Table of Contents

1 Checkbox Element - #checkbox {}

The checkbox element produces an HTML checkbox.


#checkbox { id=checkbox1, text="Check Me", checked=true }


text - (string)
The checkbox's label.
html_encode - (boolean)
Set to true to safely html-encode the text.
label_position - (/'after', 'before', or 'none')
Set the positioning of the provided text label relative to the checkbox itself. If set to 'none', no text label will be rendered at all. Default: ='before'. (*Note:* =after is a keyword in Erlang, so you must ensure you wrap the after with single quotes like 'after').
postback - (Erlang term)
If set, clicking on the checkbox will initiate a Nitrogen postback with the supplied term.
checked - (boolean)
True if the checkbox should be checked.
value - (string)
The value that will be posted if checked. The default HTML behavior is the string "on"
html_name - (string)
The name attribute of the checkbox.

Special Note about HTML, Checkboxes, and Nitrogen posbacks

In HTML Forms, a checkbox element is only submitted if the checkbox is actually checked. Nitrogen follows this pattern in its postbacks, which might be undesirable in certain situations. To alleviate this, there is a plugin called always_checkbox, which always submits. It has not been rolled into mainline Nitrogen yet, as its still in an experimental stage (basically trying to get the API right).

[=#always_checkbox= on Github](

Date: 2015-01-29 17:28:09 CST

Author: Rusty Klophaus (@rustyio)

Org version 7.8.02 with Emacs version 23

Validate XHTML 1.0


Note:To specify code blocks, just use the generic code block syntax:
<pre><code>your code here</code></pre>

comments powered by Disqus