Checkbox help!

Hello!

I want to ask for help. I created a form that works perfectly. I placed a checkbox in it.
When the answer arrives, it contains true/false.
Can I change the word true/false to my language so that it doesn’t write in English in the email?

Thank you very much

Not at my Mac at the moment, but yes, you should be able to.
The visible online side via the text next to the checkbox, and the ‘behind the scenes’ bit in what (I think) is called the Values or Attributes box.
Someone sitting there their computer with probably correct me! :grimacing:

The attribute field is empty for me. I just don’t understand why. Why should it be there?

Hi, Change the name in the right Settings panel - just had a look and correcting myself!

I know that too.
The problem is that the answer I receive in the email is in English, and I cannot change it to another language.

This would be my problem too, in php.
Can anyone help with this?

Ah, my apologies. I read the question wrong.
Sorry, can’t help here. Best of luck.

Hi @Boss81

Find the form php file in the includes folder - it should be named whatever id you assigned to the form.

Open it up in a text editor & after the line:

$subscribe = $_POST['subscribe'];

paste in this (change ‘newtrue’ & ‘newfalse’ to whatever words you want):

if ($subscribe == "true") {$subscribe = "newtrue";}
else {$subscribe = "newfalse";}

Now you’ve had your php lesson for the day :grin:

Bill
BricsDesign

2 Likes

Thanks for the help.
Either I can’t find it, or I just don’t know in which line it should be inserted. As I tried, it’s not good.
I’ll have a look in the morning.

This code is in the php file.
There are three options for me.
I should put it in for the 3 inputs, but I can’t take it. :cry:
I don’t know where to paste it, no matter how hard I look. PHP is not my world.

<?php	
	if (empty($_POST['name_38514']) && strlen($_POST['name_38514']) == 0 || empty($_POST['email_38514']) && strlen($_POST['email_38514']) == 0 || empty($_POST['message_38514']) && strlen($_POST['message_38514']) == 0)
	{
		return false;
	}
	
	$name_38514 = $_POST['name_38514'];
	$email_38514 = $_POST['email_38514'];
	$input_495 = $_POST['input_495'];
	$input_917 = $_POST['input_917'];
	$input_1871 = $_POST['input_1871'];
	$message_38514 = $_POST['message_38514'];
	$optin_38514 = $_POST['optin_38514'];
	
	$to = '........................@gmail.com'; // Email submissions are sent to this email

	// Create email	
	$email_subject = "Message from a Blocs website.";
	$email_body = "You have received a new message. \n\n".
				  "Name_38514: $name_38514 \nEmail_38514: $email_38514 \nInput_495: $input_495 \nInput_917: $input_917 \nInput_1871: $input_1871 \nMessage_38514: $message_38514 \nOptin_38514: $optin_38514 \n";
	$headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n";	
	$headers .= "From: .............@gmail.com\r\n";
	$headers .= "Reply-To: $email_38514";	
	
	mail($to,$email_subject,$email_body,$headers); // Post message
	return true;			
?>

I don’t know why you have weird names for the variables, as I believe those are taken from the labels you set up in the form, but I’ll just use what you showed me.
Assuming that the checkboxes are the 3 input variables: (be sure to change ‘newtrue’ & ‘newfalse’ to the words you want)

After:
$input_495 = $_POST[‘input_495’];

if ($input_495 == "true") {$input_495 = "newtrue";}
else {$input_495 = "newfalse";}

After:
$input_917 = $_POST[‘input_917’];

if ($input_917 == "true") {$input_917 = "newtrue";}
else {$input_917 = "newfalse";}

After:
$input_1871 = $_POST[‘input_1871’];

if ($input_1871 == "true") {$input_1871 = "newtrue";}
else {$input_1871 = "newfalse";}

Hope that gives you enough to see how to do it, otherwise I’m available for hire.

Bill
BricsDesign

1 Like

@Bill

Hello Bill!

Thanks for the help, everything is clear now, I tried it and it works perfectly. Thank you so much for your help, I appreciate it.

Best regards: