Switch checkbox condition

Hi,
Seems like something basic but can’t get it to work.
How do I set the condition that if the switch is checked.

Screenshot 2021-10-23 at 22.31.18

I tried:
$_POST.announcement==1
$_POST.announcement==“checked”
$_POST.announcement==true

If a checkbox is checked it will send its value on form submit. So add a value for it, for example 1.
In your server action you just need to check:

{{$_POST.announcement}}

It will be true when the post variable returns a value on form submit, i.e. when checked.

3 Likes

Thank you