Skip to content
Essentials for YOOtheme Pro

Form Validation

Form validation ensures submitted data meets your requirements before processing. The validation is processed at three levels:

  1. Client-side validation - Optional browser validation before submission
  2. Server-side validation - Always runs to ensure data integrity
  3. CAPTCHA verification - Optional human verification to prevent spam

Field Validation

Each field has its own validation rules that will be used for both client and server side validation. For complete validation options see the form field elements documentation.

Client-side Validation

HTML5 validation provides instant feedback in the browser using native validation UI. Is enabled by default, but you can disable when:

  • Only server-side validation is needed
  • Error message doesn't mach your site styling
  • Design consistency across browsers is important

Custom Error Messages

HTML5 validation messages cannot be customized. To use custom messages, disable client side validation on the form settings and rely on server-side validation instead.

Server-side Validation

Always active and cannot be disabled. Validates all submissions regardless of browser settings, ensuring:

  • Required fields are completed
  • Field values match validation patterns
  • Data types are correct
  • CAPTCHA challenges pass (when present)

Custom Validation

Add custom validation logic using the Validate Action. This lets you validate data against custom condition rules. Failed validation stops all subsequent actions.

CAPTCHA Validation

CAPTCHAs verify users are human, protecting forms from spam and automated abuse. Add CAPTCHA when your form:

  • Is publicly accessible
  • Receives spam submissions
  • Handles sensitive operations (registration, password reset)
  • Must meet security compliance requirements

Best Practice

Combine CAPTCHA with built-in honeypot protection for optimal spam defense. Honeypots catch simple bots; CAPTCHAs stop sophisticated attacks.


reCAPTCHA

The reCAPTCHA element integrates Google reCAPTCHA service that helps protect websites from spam and abuse, supporting both v2 and v3.

reCAPTCHA Element

SettingDescriptionDynamic
TypeThe type of captcha to display, v2 Checkbox, v2 Invisible or v3.
Site/Secret KeyThe sit and secret keys obtained from reCAPTCHA Dashboard.
Error MessageA message that will be displayed if the element validation fails. Optionally use {fieldlabel} as a placeholder, it will be replaced with the field label.

TIP

The reCAPTCHA Admin Console allows you to manage your reCAPTCHA site and secret keys, and configure the settings of those at any time. It also allows you to permanently delete your reCAPTCHA keys.

reCAPTCHA v2

reCAPTCHA v2 verifies if an interaction is legitimate with a captcha challenge presented in two variations.

TIP

By default, only the most suspicious traffic will be prompted to solve a captcha. To alter this behavior edit the site security preference under the reCAPTCHA Admin Console advanced settings.

"I'm not a robot" Checkbox

Requires the user to click a checkbox indicating is not a robot.

reCAPTCHA v2 Checkbox

SettingDescriptionDynamic
LabelThe title for the field that represent the field data.
ThemeThe field style output, Light or Dark.
SizeThe field size output, Normal or Compact.

Invisible reCAPTCHA badge

A captcha might be invoked when the form is submitted, but the badge is always visible.

reCAPTCHA v2 Invisible

SettingDescriptionDynamic
PositionThe badge position, Bottom Left, Bottom Right, or Inline.
LabelThe title for the field that should represent the field data, when the position is set as Inline.
ThemeThe badge style output, Light or Dark.

reCAPTCHA v3

reCAPTCHA v3 verifies if an interaction is legitimate without any user interaction, instead of showing a CAPTCHA challenge it evaluates based on the returned score by the API.

SettingDescriptionDynamic
Score ThresholdThe value below which to consider the submitter a bot. The score runs from 0.0 (bot) to 1.0 (human).
ActionThe action name for the captcha request. Used for more advanced integrations, may only contain alphanumeric characters and slashes.

hCaptcha

The hCaptcha element integrates hCaptcha anti-bot solution that protects user privacy and rewards websites.

hCaptcha Element

SettingDescriptionDynamic
TypeThe type of captcha to display, Checkbox or Invisible.
Site/Secret KeyThe Site and Secret keys obtained from hCaptcha Dashboard.
ThemeThe theme style, Light or Dark.
Score ThresholdThe threshold over which to consider the submitter a bot. From 0.0 (no risk) to 1.0 (confirmed threat), available only for hCaptcha Enterprise.
Error MessageA message that will be displayed if the element validation fails. Optionally use {fieldlabel} as a placeholder, it will be replaced with the field label.

Checkbox

A variation that will render a "checkbox" style field by which the captcha challenge could be initiated by the user.

hCaptcha Checkbox

SettingDescriptionDynamic
LabelThe title for the field that represent the field data.
SizeThe size of the checkbox, Normal or Compact.

Invisible

A variation that will only render the Compliance text initing the challenge when the form is submitted.

SettingDescription
ComplianceA legally required text to comply with online privacy laws. Make sure it links to hCaptcha Privacy Policy and Terms of Service.

Turnstile

The Turnstile element integrates Cloudflare Turnstile captcha alternative.

Turnstile Element

SettingDescriptionDynamic
AppearsWhen should the widget appear, Always or When Interaction Required.
Site/Secret KeyThe Site and Secret keys obtained from Turnstile Dashboard.
LabelAn optional label for the field.
ThemeThe widget theme style, Light or Dark.
SizeThe widget theme size, Normal or Compact.
ComplianceOptional override of the legally required text to comply with online privacy laws. It should link to Turnstile Privacy Policy and Terms of Service.
Error MessageA message that will be displayed if the element validation fails. Optionally use {fieldlabel} as a placeholder, it will be replaced with the field label.

Friendly Captcha

The Friendly Captcha element integrates Friendly Captcha anti-bot solution that is GDPR compliant and made in Europe.

Friendly Captcha Element

SettingDescriptionDynamic
Site/API KeyThe Site and API keys obtained from Friendly Captcha Dashboard.
LabelThe title for the field that represent the field data.
EndpointThe primary endpoint for the puzzles and verification requests. Note that this feature requires a FriendlyCaptcha premium plan and to be specifically enabled.
LanguageThe language for the captcha, defaults to the site language.
Error MessageA message that will be displayed if the element validation fails. Optionally use {fieldlabel} as a placeholder, it will be replaced with the field label.