Required option {…}!
An option is a form feature that consists of a pre-formulated phrase and an associated form field such as a checkbox to select that option. A required option is an option whose checkbox must be checked by a user before the form can be accepted.
Required options are used to get a legally necessary confirmation from a user or to get an agreement to the terms of service for example.
How to
Like any option, required options are marked by curly brackets at the start of a line. In the case of a required option the right curly bracket is followed by an exclamation mark {…}!
which is followed by a space and the option’s text that a user is supposed to agree to.
The content between the left curly bracket {
and the right curly bracket }
is called key. The key is not publicly displayed, but it gets sent and can be processed programmatically when the form is submitted.
Example
{TOS accepted}! I agree to the terms of service.
For developers
When Aneamal is translated to HTML, a required option is turned into an HTML input element with an attribute required, followed by a label element. So the required option in the example becomes:
<input id='_1' name='_1' form='_f1' type='checkbox' value='TOS accepted' required> <label for='_1'>I agree to the terms of service.</label>
All options within a block are wrapped in a HTML fieldset element.