Attention
TYPO3 v11 has reached end-of-life as of October 31th 2024 and is no longer being maintained. Use the version switcher on the top left of this page to select documentation for a supported version of TYPO3.
Need more time before upgrading? You can purchase Extended Long Term Support (ELTS) for TYPO3 v11 here: TYPO3 ELTS.
JavaScript Form Helpers
Empty Checkbox Handling
<input type="checkbox" name="setting" value="1" data-empty-value="0"
data-global-event="change" data-action-navigate="$data=~s/$value/">
Copied!
Checkboxes used to send a particular value when unchecked can be achieved by using
data-
. If this attribute is omitted, an empty string ''
is sent.
Submitting a Form on Change
<input type="checkbox" data-global-event="change" data-action-submit="$form">
<!-- ... or (using CSS selector) ... -->
<input type="checkbox" data-global-event="change" data-action-submit="#formIdentifier">
Copied!
Submits a form once a value has been changed.
($form
refers to parent form element, using CSS selectors like #form
is possible as well)