CMS help pages
  
You are here: Home > Developers > How to build templates > Forms

Forms

See also end user information.

Creating forms within the CMS is simple using the following code:

<cms type=form id=your_form_id scope=folder>

... your form fields ...

</form>

The CMS tag creates the opening <form> tag, but you must remember to include the closing </form> tag after your form fields.

The user will be presented with two editable elements:

  • the target page the visitor will arrive at after the form is processed, and
  • the email address to which the form will be sent.

The target email address can be on any domain and there is no special setup required.

The form may be tested within the CMS, and the form contents will be emailed to the email address associated with the user (not the website), which means that as a developer you can test forms and have the contents arrive in your own inbox without changing any settings.

The ID of the form will be included in the subject line of the email as will the URL of the page on which the form is published.

The forms include anti-spam measures and visitor tracking data.

The same form may be used on multiple pages, multiple forms may be created and multiple forms may be used on a single page.

Use the scope parameter to save time. If a form will appear on various pages but will always go to the same target page and email address set the scope to all.

Validation

To validate a field, prefix the field name with validate_ (not case sensitive), e.g.:

<input type=text value="" name=validate_telephone>

This provides a simple "not empty" validation for text fields.

Fixed field names

Each of these field names may be prefixed with "validate_" to ensure that something is entered by the enquirer. Field names are not case sensitive.

Enquirer's name

The field name for the Enquirer's name must be either:

"name"

or two fields: "first_name" and "last_name"

Enquirer's company

"company"

Enquirer's email address

"email"

Example 1:

<cms type=form id=contact scope=all>
<input type="text" name="validate_name">
<input type="text" name="company">
<input type="text" name="validate_email">
<input type="submit">
</form>

Example 2:

<cms type=form id=contact scope=page>
<input type="text" name="first_name">
<input type="text" name="last_name">
<input type="text" name="validate_company">
<input type="text" name="validate_email">
<input type="submit">
</form>

Reserved field names

Do not prefix any field names with cms_ as these fields are used by the CMS.