Form changes

2 replies · opened Nov 4, 2016

IivanpossNov 4, 2016

Re: Form 6 changes

I didnt need "service" field and all of its choices but needed "organization" so I commented out the choices and then changed all references from "service" to "organization" in both HTML and PHP file and seems to be working. Was the correct procedure?

Now I need "Name" split into 2 fields "First" and "Last" name. So I can change "Name" into "First" and all of its reference in PHP, but how do I add a "Last" field.

Do I just copy and paste the name div code in HTML and then add references in the PHP by copying all of the other line codes and substituting "Last"? Thats what I'm figuring but would like confirmation.

ALSO: I would like to change the "success" message location (it appears near top right corner) and move to center of the screen. What coding do I need to add and where?

Thanks!

SSemicolon WebSTAFFNov 4, 2016

Hello,

  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:

  2. 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

" : '';

Example:

$newfield = isset($newfield) ? "New Field: $newfield

" : '';
  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.

  1. Unfortunately, this is not Supported. Only the Notifications positions defined here: http://themes.semicolonweb.com/html/canvas/modal-popovers.php are supported.

Hope this Helps! Do let us know if we can help you with anything else or if you find any further issues with Canvas.

IivanpossNov 4, 2016

Thanks!

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