DOCUMENTATION

Search »

Form Builder

Adding a reCAPTCHA to your Form Builder forms

Note: in order to use reCAPTCHA in your Form Builder forms, you need to have the Form Tools API installed and have set up an account with reCAPTCHA. Click here to read instructions on how to install the API and set up the account.

Add Form -> Select Form Type page
Add Form -> Select Form Type page
Spam is always a problem. To help prevent people from spamming your forms, the Form Builder comes with built-in support for reCAPTCHA - a free service that helps to digitize books as well as fighting spam.


How to add a reCAPTCHA to a form page

First, decide where you want the reCAPTCHA to appear: on a particular form page, or the review page (if your published form includes one). This section explains how to add it to one of your form pages; see the section below to add it to your form's Review page.

  1. Go the Modules » Form Builder module and select the Template Set you are using to publish your form.
  2. There, on the Templates tab, select the appropriate Form Page template. Note: if the template set has more one Form Page template and you're not sure which one you're using, return to the Form Builder (Edit Form » Publish tab » edit icon) and look in the left sidebar to find out which.
  3. In the template, at whatever spot you want (right before the continue_block is usual!), add the following code: What that does is look at the current page number, and if it's equal to 1, display the CAPTCHA. You can change that number to whatever you want, but bear in mind that if you plan on re-using the template set again, the reCAPTCHA may not appear on the page that you want. For information on targetting a particular form or View, give this page a read over.

How to add a reCAPTCHA to a form's Review page

You may feel that it's a better idea to add your reCAPTCHA at the very last step: that way you don't discourage people from filling in the form right from the start. Here's how to add a reCAPTCHA to your Review page.

  1. Go the Modules » Form Builder module and select the Template Set you are using to publish your form.
  2. There, on the Templates tab, select the appropriate Review Page template. Note: if the template set has more one Review Page template and you're not sure which one you're using, return to the Form Builder (Edit Form » Publish tab » edit icon) and look in the left sidebar to find out which.
  3. In the template, at whatever spot you want (right before the continue_block is usual!), add the following code: That will output a fully-functional CAPTCHA to your Review page, preventing someone from submitting the form until they filled in the answer correctly.

Auto-hide reCAPTCHA after correct response

If you chose to display the CAPTCHA on a form page, and your form contains multiple pages (either with more than one form pages, or a Review page), it's possible that your users will return to the page to edit some information. In those instances, you don't want them to have to re-enter the reCAPTCHA!

The Form Builder automatically keeps track of whether a person has entered the reCAPTCHA correctly and won't make them re-enter it a second time.

Styling your reCAPTCHA

reCAPTCHA offers several themes. Depending on your form styles, you may well want to change it from the default styles. Here's how to do it:

  1. Go the Modules » Form Builder module and select the Template Set you are using to publish your form.
  2. On that Templates tab, select the Header template you are using for your form.
  3. In the <head> section, add the following code: Where "theme_name" is "red", "white", "blackglass" or "clean".
  4. Save the template and refresh your form page. Hey presto!