Check

A checkbox with its label beside it.

Forms Added in v0.76.3 Updated

Default


{ui field}
	{ui check, name: 'terms', label: 'Accept the terms' /}
{/ui}

The label sits beside the box, and checked turns it on. value is what it submits when on, 1 by default. Put it in a field with no label, so the hint and error still sit under it.

Submit when off

Sends 0 when unticked, so the server sees the change.


{ui field, name: 'news', hint: 'Sends 0 when unticked, so the server sees the change.'}
	{ui check,
		name: 'news',
		label: 'Send me the newsletter',
		checked: true,
		off: '0',
	/}
{/ui}

A browser sends nothing for an unticked box. off adds a hidden input ahead of the checkbox with that value, so the server sees the change from on to off.