Documentation · ViewHelper reference

Form / CheckboxViewHelper

View Helper which creates a simple checkbox ().



<f:form.checkbox name="myCheckBox" value="someValue" />



<f:form.checkbox name="myCheckBox" value="someValue" checked="{object.value} == 5" />


(depending on $object)

Bind to object property

<f:form.checkbox property="interests" value="TYPO3" />


(depending on property "interests")

  • Tag usage example

    <f:form.checkbox additionalAttributes="{foo: 'bar'}" data="{foo: 'bar'}" checked="1" multiple="1" name="NULL" value="foo" property="NULL" disabled="NULL" errorClass="'f3-form-error'" class="NULL" dir="NULL" id="NULL" lang="NULL" style="NULL" title="NULL" accesskey="NULL" tabindex="123" onclick="NULL">
    	<!-- tag content - may be ignored! -->
  • Inline usage example

    {f:form.checkbox(additionalAttributes: {foo: 'bar'}, data: {foo: 'bar'}, checked: 1, multiple: 1, name: 'NULL', value: 'foo', property: 'NULL', disabled: 'NULL', errorClass: ''f3-form-error'', class: 'NULL', dir: 'NULL', id: 'NULL', lang: 'NULL', style: 'NULL', title: 'NULL', accesskey: 'NULL', tabindex: 123, onclick: 'NULL')}


Argument Description Type

Keyboard shortcut to access this element


Additional tag attributes. They will be added directly to the resulting HTML tag.


Specifies that the input element should be preselected


CSS class(es) for this element


Additional data-* attributes. They will each be added with a "data-" prefix.


Text direction for this HTML element. Allowed strings: "ltr" (left to right), "rtl" (right to left)


Specifies that the input element should be disabled when the page loads


CSS class to set if there are errors for this view helper


Unique (in this file) identifier for this HTML element.


Language for this element. Use short names specified in RFC 1766


Specifies whether this checkbox belongs to a multivalue (is part of a checkbox group)


Name of input tag


JavaScript evaluated for the onclick event


Name of Object Property. If used in conjunction with , "name" and "value" properties will be ignored.


Individual CSS styles for this element


Specifies the tab order of this element


Tooltip text of element


Value of input tag. Required for checkboxes

Required attribute

Revision history

commit ebb9b4b164e99fe7f9d3cd95af6f464f6f6ca846
Author: Bastian Waidelich <*****>
Date:   Mon Aug 31 19:10:20 2009 +0000

    [FEATURE] Fluid (ViewHelpers): Backported checkbox & radio form viewHelpers from Fluid
    [-BUGFIX] Fluid (ViewHelpers): Removed unused "options"-argument from formViewHelper
    [+FEATURE] Fluid (ViewHelpers): Added "actionUri"-argument to formViewHelper which allows to explicitly set the forms action attribute
    [~TASK] Fluid (ViewHelpers): Adapted viewHelpers to latest changes of UriBuilder (Extbase revision 1179)
    [~BUGFIX] Fluid (ViewHelpers): SubmitViewHelper now correctly extends Tx_Fluid_ViewHelpers_Form_AbstractFormFieldViewHelper
    [-TASK] Fluid (Tests): Removed obsolete file ViewHelperBaseTestcase_testcase.php

commit c2898a434a24fbd3303609798dcfc16c01b9197a
Author: Sebastian Kurfürst <*****>
Date:   Wed Sep 16 10:06:17 2009 +0000

    [+FEATURE] Fluid (ViewHelpers): Added a PaddingViewHelper
    [+FEATURE] Fluid (ViewHelpers): Added a RenderFlashMessages ViewHelper
    [TASK] Fluid (Core): Added a PaddingViewHelper
    [TASK] Fluid (Core): Added an exception if ViewHelpers declare an argument multiple times.

commit 360c781d1ac4e300f22d713a1926a9af7e4fa835
Author: Sebastian Kurfürst <*****>
Date:   Mon Oct 12 06:23:39 2009 +0000

    [+FEATURE] tx_fluid (ViewHelpers): Prepared ViewHelpers for Request Hash (HMAC) generation. Relates to #4960.
    [+FEATURE] tx_fluid (Core): Implemented editing of properties for nested objects in forms. Resolves #3702.
    [+TASK] tx_fluid: Backported everything which results in comment-changes and some formatting changes.

commit 9b2830bc1c17588dd69a463773c5f05f61b5cf94
Author: Sebastian Kurfürst <*****>
Date:   Sat Oct 24 11:01:38 2009 +0000

    * A*****@api annotations
    * Changed the fluid-specific RuntimeException to SPL's RuntimeException.

commit 7868047c52417ff4e1f3e99e45adaba1ee3d0a24
Author: Sebastian Kurfürst <*****>
Date:   Sat Oct 24 11:49:45 2009 +0000

    [~TASK] Fluid: A*****@package and @subpackage annotations.

commit 1226e4513085f71a11b7f4a3285f1ce4e5068789
Author: Sebastian Kurfürst <*****>
Date:   Tue Jun 15 11:49:15 2010 +0000

    [+BUGFIX] Fluid (Core): Now, it is possible to "unselect" checkboxes in editing forms; also with multiselect checkboxes. Resolves #5638

commit 2e80158231ee39738c670826fceac504fa58314e
Author: Sebastian Kurfürst <*****>
Date:   Tue Jun 15 17:33:21 2010 +0000

    [~BUGFIX] Fluid (ViewHelpers): Fixed a half-finished documentation. Related to #5638.

commit 186bdaeac89820779f91853b830cc95d60c7ad58
Author: Bastian Waidelich <*****>
Date:   Tue Jul 13 09:42:26 2010 +0000

    [-TASK] Fluid: R*****@version annotation from all Fluid classes to ease the backporting process. Relates to #8835 (backported from Fluid package)

commit 1d36de6ed90007e324b773782e8f0a1d1c1191a2
Author: Bastian Waidelich <*****>
Date:   Tue Jul 13 10:12:30 2010 +0000

    [-TASK] Fluid: R*****@package/@subpackage annotations from all Fluid classes. They have already been removed in FLOW3 packages in r2813.

commit 69f1505177a975f699b1638ee3f7b1f9730f7936
Author: Bastian Waidelich <*****>
Date:   Thu Jul 15 17:25:11 2010 +0000

    [!!!][+TASK] Fluid (ViewHelpers): The value argument is required again in form.checkbox and ViewHelpers. This is a breaking change, as the value argument has not been mandatory for a while. But it probably won't break existing templates as omitting the value makes no sense at all. Relates to #8852 (backported from Fluid package r4864)
    [+FEATURE] Fluid (Core): implemented overrideArgument() method in AbstractViewHelper to be able to override previously registered arguments in subclasses. This resolves #8852 (backported from Fluid package r4864)
    [+BUGFIX] Fluid (Core): Negative numeric values are properly converted to FALSE when used in boolean ViewHelper arguments. This resolves #8893 (backported from Fluid package r4864)

commit c987bb6f0aa8371fa64c87db0f64aa6cb956743c
Author: Bastian Waidelich <*****>
Date:   Mon Jul 19 21:00:05 2010 +0000

    [+BUGFIX] Fluid (ViewHelpers): Now, it is possible to "unselect" checkboxes and multiselect fields in editing forms. This fixes #5638. This fixes #8535. This fixes #6897 (improved forward-backport from Fluid package r4874)

commit 472451987ca0530fa5828bb0b79fcafa2f905a35
Author: Bastian Waidelich <*****>
Date:   Fri Nov 19 20:58:09 2010 +0000

    [-TASK] Fluid: R*****@scope annotations as they are not used in v4

commit dd8928aed4c119d8db37322acb91ded24ba5cc35
Author: Bastian Waidelich <*****>
Date:   Thu Dec 30 16:21:11 2010 +0000

    [+TASK] Fluid (ViewHelpers): Fix, cleanup and extend inline documentation of ViewHelpers
    Resolves #10908

commit fd09d197fa8886b97cb20aa9573f39cd08ce989e
Author: Bastian Waidelich <*****>
Date:   Thu Nov 10 18:27:58 2011 +0100

    [TASK] S*****@author annotations
    This backports three recent changes of the TYPO3.Fluid package:
    - R*****@license annotation from files (290f4f5)
    - Simplify license header in PHP files (14bacba)
    - D*****@author tags from source code (9c2e837)
    This should not contain any functional change!
    Change-Id: I9376dca4af78c4f0f82413011d115b8ad04634dd

commit ec3891d8d4e339d8319428211207e6201be9fd73
Author: Thomas Maroschik <*****>
Date:   Wed Oct 17 21:18:26 2012 +0200

    [TASK][WIP] Move non class code back to source files
    Change-Id: I620d2e61860142cdc89cc83474c95542799961c0

commit 554e8f890dcc0dd86a27518b58e2b54be26fd37e
Author: Thomas Maroschik <*****>
Date:   Wed Oct 17 22:20:17 2012 +0200

    [TASK] Namespace classes
    Change-Id: Ia7432e1c923826ed58206bca15fb94509adbd508

commit 547ef7f60f39c6bfcb0376e5e76070da85860098
Author: Arvid Jakobsson <*****>
Date:   Mon Sep 17 21:25:51 2012 +0200

    [TASK] Remove superfluous parenthesis in sysexts
    Superfluous brackets in fluid after namespaces move
    Change ("a" . "b") . "c" into "a" . "b" . "c" using the lex-pass tool.
    Resolves: #41016
    Related: #40095
    Releases: 6.0
    Change-Id: I64741473cb24eda343f0576ebd1a0f1846dfc3f8
    Reviewed-by: Oliver Hader
    Tested-by: Oliver Hader

commit 9d13dedf017b614b834261b1bf5d4acb2201f1d4
Author: Alexander Schnitzler <*****>
Date:   Fri Nov 16 19:49:02 2012 +0100

    [CLEANUP] Replace FLOW3 with TYPO3 Flow
    Releases: 6.0
    Fixes: #43036
    Change-Id: I62df23587301b4cde3ddeae3686b34f54fe1182e
    Reviewed-by: Alexander Schnitzler
    Tested-by: Alexander Schnitzler

commit 9d46e6932d35c79bf87c96fa38b8e537c4192f23
Author: Alexander Schnitzler <*****>
Date:   Tue Nov 20 16:27:02 2012 +0100

    [CLEANUP] Adjust code to CGL and fix small namespace bugs
    * whitespaces, tabs and blank line issues
    * bool -> boolean
    * int -> integer
    * fix wrong namespace annotations
    Fixes: #43157
    Releases: 6.0
    Change-Id: I8397948e19248db029d8efd1555ee56e4982742d
    Reviewed-by: Helmut Hummel
    Tested-by: Helmut Hummel

commit 5ffb7339673117efa22d3d18729f971ddf4784df
Author: Alexander Schnitzler <*****>
Date:   Sat Jun 1 11:56:21 2013 +0200

    [BUGFIX] Enable CheckboxViewHelper binding to ArrayObject and Null
    Currently the checkbox view helper relies on a present
    form object which is not necessary any longer since 6.1
    as the new property mapper is active by default.
    Therefore the viewhelper must be adjusted to be able to
    be bound to ArrayObject objects or Null which throws an
    exception till now.
    Releases: 6.2, 6.1
    Resolves: #48628
    Change-Id: I35b70fb0a09ddd72da1c64ec5c7c5456e9af9471
    Tested-by: Adrian Dymorz
    Reviewed-by: Wouter Wolters
    Tested-by: Wouter Wolters
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring

commit 77f29a3c69a7cbb27b34072754aa503bace6c9f1
Author: Christian Kuhn <*****>
Date:   Tue Oct 1 14:40:56 2013 +0200

    [TASK] Remove closing PHP tags
    Change-Id: Iaa92566c53301e49396fc9fb26b0b339c48d567b
    Resolves: #52360
    Releases: 6.2
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn
    Reviewed-by: Ernesto Baschny
    Tested-by: Ernesto Baschny
    Reviewed-by: Anja Leichsenring
    Tested-by: Anja Leichsenring

commit 96d7220d06c68b36fb4c05b359b70c2160bc16ce
Author: Georg Ringer <*****>
Date:   Mon Feb 10 07:51:19 2014 +0100

    [TASK] Fix typos all over the core
    Change-Id: I40990623e3d53e70666438acafc27275ac36b621
    Resolves: #55827
    Releases: 6.2
    Reviewed-by: Christian Kuhn
    Tested-by: Christian Kuhn