Using reCaptcha v2 for your forms

Updated on 09-April-2019 at 6:23 PM

Business Catalyst End of life announcement - find out more details.

This article will show you how to make sure you are using the newest bot-protection module on your forms.

Do note this article only refers to regular Web forms & Campaign subscribe forms, for the  Comment forms for example, there is no action required.

Add reCaptcha v2 to your webforms:

  1. Go to Site Manager->Web forms and select your form
  2. from the Misc tab, click on Recaptcha V2
  3. Recaptcha V2 is now inserted into your form, as you can see in the webform preview on the right
  4. Insert the webform onto the page you want

Replace the old bot protection modules with reCapcha v2 on webforms

  1. Go to Site Manager->Web Forms and select your webform
  2. Go to the Misc tab
  3. Remove the old bot protection modules (Image verification or Recaptcha):
    remove.png
  4. insert the new Recaptcha V2 instead:
    remove.png
  5. Save the form
  6. Now you need to go to every page this form is inserted into and update it. The form update can be done in two ways:
    • completely delete the form's HTML code from the page and reinsert the form
    • replace the old recaptcha modules with the new one. To do this simply replace
      {module_recaptcha} or {module_captchav2}
      with
      {module_recaptcha version="2"}

Replace the old bot protection modules with reCapcha v2 on campaign subscribe forms

You need to edit every page the campaign subscribe form is inserted into, and update it. The form update can be done in two ways:

  • completely delete the form's HTML code from the page and reinsert the form
  • replace the old recaptcha modules with the new one. To do this simply replace
    {module_recaptcha} or {module_captchav2}
    with
    {module_recaptcha version="2"}

Add reCapcha v2 on campaign subscribe forms

Option A: re-insert the form(s)

  1. Edit every page the campaign subscribe form is inserted into completely delete the form's HTML code from the page and reinsert the form

Option B: manually update existing form(s) to add reCaptchav2 code

You need to edit every page the campaign subscribe form is inserted into and update it. There are two steps to the process:

  1. Add the recaptcha module in the code. To do this, simply add the reCaptchav2 module at the end of the form:
    {module_recaptcha version="2"}
  2. Add the JavaScript form validation code into page. In JS validation code section, add these lines to the checkWholeForm<form_id>(theForm) function definition:
    
    if (theForm.CaptchaV2) why += captchaIsInvalid(theForm, "Enter Word Verification in box below", "Please enter the correct Word Verification as seen in the image");
    if (theForm['g-recaptcha-response']) why += reCaptchaV2IsInvalid(theForm, "Please prove you're not a robot");