Developer Support »

Adding extra fields

The standard form that comes with the script has three fields: "name", "email" and "comments". You can add any number of fields to the form which the script will process without you having to make any changes to the script itself. The script automatically takes any fields submitted to it and sends the data from them to you in an email.

Adding extra fields to the form is an HTML exercise and as such is outwith the scope of the script and support. The script will not make additional fields for you. It will not make a form for you (to get you started the code for the standard form is included). The script just processes forms, it doesn't make them.

There are plenty of HTML tutorials online about making forms should you need assistance but you should note the points below.

The script returns the name of the field and the value(s) entered by the visitor. It is better to make the name human-readable as this is what you will see in the email sent to you.

If you are using a multiple select (drop-down list) where you want the user to select more than one option, or if you are using multiple checkboxes with the same name, then you must name the field as an array, using square brackets []. This is a requirement of PHP and is not peculiar to this script. Here's an example of multiple checkboxes with the same name (note the square brackets, a left bracket and a right bracket with no space in between):

<input type="checkbox" name="fruit[]" value="apple">Apple
<input type="checkbox" name="fruit[]" value="orange">Orange
<input type="checkbox" name="fruit[]" value="banana">Banana

Here's an example of a multiple select input:

<select name="fruit[]" size="3" multiple>

When you make changes to your form, you must save the webpage containing the form and upload it to your webspace. You do not need to touch the script. You would only need to edit the script (pro version) if you wanted to make any of the extra fields required fields.