Page 1 of 1

Checkbox

Posted: 2020-11-11 15:04
by fciprian
Hello

I need some support please.
I have set up to send me an email when a record is added.
Everything works well. BUT :) on a field with Check box. If it is checked in database is 1 and if it is not in 0.
How can i make in email to show me in sted of 1 to be shown YES and if it is 0 to be shown NO in the email ?

Thank you
I apriciate your help!!!!

Re: Checkbox

Posted: 2020-11-11 20:01
by ksabra

Code: Select all

	$status = $data['check fieldname'];
	if ($status == 1) {$status = "YES";}
	else $status = "<strong>NO</strong>";
mail body

Code: Select all

<?php echo $status; ?>

Re: Checkbox

Posted: 2020-11-13 07:26
by onoehring
Hi,

why not use radio buttons (but this will make you need to change the datatype):
ec_options.png
ec_options.png (41.15 KiB) Viewed 1906 times
Olaf