Add an Enquiry form to your site (article)

Susana Moleón Moya
Susana Moleón Moya
  • Updated

Enquiry forms can be used for general "Contact us", "Brochure request", "Newsletter signup" or other non product/date specific requests. This works for any type of information that you want to collect on your website and funnel into your workflow (assign to a staff member, set a follow-up date, etc).

If instead, you are looking to collect product and date-specific requests you may want to consider using the Booking Engine, remember you can fully customize all the wording so that the customer knows they are just making an enquiry/quote request.

To launch "Enquiry form builder" (beta) click on this link:

https://www.tourcms.com/support/wizards/enquiry_form_builder/

How it works

Just build a normal web form pointing at the TourCMS servers (action="https://live.tourcms.com/enquiry.php"), make sure you have entered your Account IDEnquiry Key and Return URL and check the names of your fields match up with those listed below. Simple.

If you would like the client to receive an automated response, don't forget to configure the "Enquiry thank you" template in channel manager and also add the Channel ID field to your form so TourCMS knows which channel to take email template from.

1.png

If you have an existing form you want to use then just make sure you have added the important fields and renamed any of your other fields to match the table below and you should be good to go.

All enquiry data is sent securely and encrypted via SSL.

Example form


<form method="post"action="https://live.tourcms.com/enquiry.php">
<!-- Account settings -->
<input name="tourcms_account_id"value="ACCOUNT_ID_GOES_HERE"type="hidden"/>
<input name="tourcms_channel_id"value="CHANNEL_ID_GOES_HERE"type="hidden"/>
<input name="tourcms_enquiry_key"value="ENQUIRY_KEY_GOES_HERE"tpe="hidden"/>
<input name="tourcms_return_url"value="RETURN_URL_GOES_HERE"type="hidden"/>
<input name="tourcms_problem_url"value="PROBLEM_URL_GOES_HERE"type="hidden"/>

<!-- Your fields -->
<input name="enquiry_type"value="General%20Enquiry"type="hidden"/>

<label>Title
<select name="title">
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Sir">Sir</option>
</select></label>
</label>

<label>Firstname
<input type="text"name="firstname"required="required"/>
</label>
<label>Surname
<input type="text"name="surname"required="required"/>
</label>
<label>Details
<textarea name="enquiry_detail"></textarea>
</label>
<input type="submit"value="submit"/>
</form>

Important fields

Account ID and Enquiry Key

These tell TourCMS which account the enquiry should go to, to get yours just log into TourCMS then head to Configuration & setup > Enquiries. If you haven't set an Enquiry key before then you will need to set one before you can continue.

2.png

Return URL

This should be the full URL (link) that you want your customers to be taken to once their enquiry has been stored by TourCMS, it could contain a thank you message perhaps.

Other important fields

You must ensure that you have at least one of enquiry_type, enquiry_category, enquiry_value, enquiry_outcome or enquiry_note on your form otherwise TourCMS will just create a new customer record and not an enquiry. The example above (and any form generated using our Enquiry form builder solves this by having enquiry_type set as a hidden field - this is also a good way to differentiate if you have multiple forms on your site.

Custom fields

"Extra customer data fields"

If you have configured Extra customer data fields on your account to store additional information about the customer themselves (rather than their particular enquiry) those can also be added to the form. Just name the form field(s) custom_X where X is the tag entered when the field was created. So, for example, a field with the tag "waist" should be added to the form as a field named "custom_waist".

Don't forget to validate the data you submit, numeric fields should be validated as numbers, any date fields should be in the format YYYY-MM-DD. If invalid dates are provided, or non-number values passed to the numeric field, TourCMS will place the data in the main enquiry form details so that it is not lost.

Arbitrary custom data

Any field that you add to your form which TourCMS doesn't recognise will just be added to the end of the Enquiry "Details" box, so you can be creative with your form design and add any fields you wish.

Spam blocking (experimental)

One common solution to unwanted spam/junk form submissions is to add what is known as a CAPTCHA, usually a picture of some distorted letters and numbers that the user needs to decipher and type into a box before they can submit the form.

CAPTCHAs are generally effective but are not particularly user friendly. Instead, TourCMS supports the use of a honeypot field, this is a field that is hidden from users via CSS so that only automated bots will enter anything into the box, thus any form submissions with text in the honeypot field can be ignored.

Adding a honeypot field

The basic steps are:

  • Add a regular field, usually a text field, with the name hp
  • Add a label for the field, stating that it should be left blank (in case any legitimate users have CSS disabled)
  • Give the field a tabindex of -1 and set autocomplete to off
  • Hide the field using CSS

Here's some sample code, this can be copy and pasted in to your form anywhere between the <form> and </form> tags:

<div class="tourcmshpot">
<label for="hp">Leave this field entirely blank</label>
<input type="text"name="hp"id="hp"autocomplete="off"tabindex="-1"/>
</div>
<style type="text/css">
.tourcmshpot label, .tourcmshpot input {
display: none;
}
</style>

When you view your form you should not see the text "Leave this field entirely blank" or the box itself. 

Adding an alternative return URL in case of problems

It's unlikely that a legitimate user will fill in the honeypot field, however, just in case it's a good idea to specify an alternative return URL for them to be redirected to. Try to avoid using the phrase error or problem in the URL, but do make sure the page content explains that the user's request was not submitted, perhaps offer alternative contacts.

<input type="hidden"name="tourcms_problem_url"value="PROBLEM_URL_GOES_HERE"/>

Stopping spam via existing forms

If you have an existing form that is already receiving spam you should change the enquiry key at the same time as adding the honeypot field. Don't forget you will also need to put the new key on any other enquiry forms you may have added.

Full field list

The full list of special fields are below, don't forget that any fields you add which TourCMS doesn't recognise will just get added to the enquiry "Details" in TourCMS - so you can collect all sorts of different information beyond what is listed below.

You might want to try using our Enquiry form builder to help you get the basics of your form set up.

3.png