Adding a field in the contact form.

3 replies · opened Jun 18, 2023

Mmille14Jun 18, 2023

Hi There,

We are interested in adding a field in the interior design contact form. Looking at previous tickets we found one that states the following:

"1. The way you are trying to Edit the HTML/PHP Files for adding Custom Fields is perfectly fine. There are 3 Steps to configure a New Field in the include/sendemail.php File:

  1. Find the following code and duplicate it to add the New Field:$name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : '';

Example:$newfield = isset( $_POST['template-contactform-newfield'] ) ? $_POST['template-contactform-newfield'] : '';

Make sure that the template-contactform-newfield is same as the Form Input’s name attribute in the HTML.

  1. Now, find the following code just a few lines below and duplicate it to add the New Field:$name = isset($name) ? "Name: $name<br /><br />" : '';

Example:$newfield = isset($newfield) ? "New Field: $newfield<br /><br />" : '';

  1. You now simply need to Add the New Field to the following code:$body = "$name $email $phone $service $message $referrer";

Example:$body = "$name $email $phone $newfield $service $message $referrer";

This will definitely work fine."

Does this still apply to Canvas 7? And what PHP file are these changes going to be made, as sendmail.php file is not in the package?

Thank you for your help in advance.

Mille

SSemicolon WebSTAFFJun 19, 2023

Hello,

Since Canvas v5, the Contact Forms do not use the include/sendemail.php File anymore. We have introduced a new Powerful Form Processor with include/form.php where you will never need to edit the PHP to add Fields or File Uploads. Everything is automatic and when you add New Fields to your Forms using HTML, our Form Processor will automatically add and send that Field to your emails. Consider checking the Documentations here for complete setup instructions: https://docs.semicolonweb.com/docs/forms/form-setup/ .

Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

Mmille14Jun 19, 2023

Thank you so much, it worked.

Have a great day.

Mille

SSemicolon WebSTAFFJun 19, 2023

Awesome! Very Happy to Help! :)

Do let us know if we can help you with anything else or if you find any further issues.

Have a Wonderful Day!

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard