ThemeHigh
  • Plugins
  • Bundles New
    Documentation
    WooCommerce Essential Bundle
    Feature request
    WooCommerce Checkout page Bundle
    Translation project
    WooCommerce Product page Bundle
    Build your own Bundle
    Build Your Own Bundle (BYOB)
    New
    WooCommerce Essential Bundle
    WooCommerce Checkout page Bundle
    WooCommerce Product page Bundle
    Build Your Own Bundle (BYOB)

    Best Value

    An essential WooCommerce plugins bundle to boost your performance and sales.

    • Checkout field editor for WooCommerce - $49
    • Extra product option for WooCommerce - $39
    • Email customizer for WooCommerce - $39
    • Multistep checkout for WooCommerce - $39
    • Multiple Shipping address for WooCommerce - $39
    • Variation swatches for WooCommerce - $39
    $244$122 Only
    Know more

    Best Value

    An checkout WooCommerce plugins bundle to boost your performance and sales.

    • Checkout Field Editor for WooCommerce - $49
    • Multistep Checkout for WooCommerce - $39
    • Multiple Shipping Address for WooCommerce - $39
    $127$109 Only
    Know more

    Best Value

    An product WooCommerce plugins bundle to boost your performance and sales.

    • Extra Product Option for WooCommerce - $39
    • Variation Swatches for WooCommerce - $39
    • Email Customizer for WooCommerce - $39
    • Schedule Delivery for WooCommerce - $49
    $166$119 Only
    Know more

    HOT SALE

    Your Money, Your Choice - The Savings Are On Us!

    BYOB Offer

    Get the flexibility to create your perfect plugin bundle! Pick the plugins you need and enjoy an exclusive discount —only pay for what you use!

    $100 - $149: 25% Discount

    $150 - $199: 30% Discount

    $200 - $249: 40% Discount

    Above $250: 50% Discount

    *Min 2 quantity is required to claim this offer.

    Know more
  • Documentation
  • Support
  • Partners
  • Login
  • Getting Started
    • Overview...
    • Add/Edit Custom Fields
    • Set Display Rules
    • Set Repeat Rules
    • Price Fields & Types
    • User Meta Fields
    • Time Picker Settings
    • Why Your Checkout Fields Aren’...
    • Date Picker Settings
    • Display Custom Fields...
  • Advanced Settings
    • Include New Fields in Address Format?
    • Enable Address Autofill
    • Configure Locale Override Settings
    • Add Custom Fields to CSV Export
    • Display Custom Fields In PDF Invoices & Packing Slips
    • Zapier Support
    • Display Country & State Fields based on Conditional Rules
    • WPML Compatibility
    • Where do the Custom Fields get Saved or Displayed?
    • Backup & Import Settings
    • Enable Inline Validation...
    • WPML String Translations...
    • Custom Fields in WooCommerce Orders
    • Add a New Custom Validation Rule
    • Add a New Confirm Field Validator
    • Import/Export the Checkout Fields and Sections
  • For Developers
    • Hooks & References...
    • Display Rules: Use cases and mor...
    • Repeat Rules: More use cases and...
    • Based on Checkout Fields: Use ca...
    • Override HTML Content: Examples...
    • Compatibility with “WooCom...
  • Compatible Plugin & Themes
    • Plugins & Themes...
  • Frequently Asked Questions
    • Frequently Asked Questions...
  • How
    • How To Display Fields In Order D...
    • How To Customise The Shipping Se...
    • How To Add Custom Fields In The ...
    • How to Add Custom Price Fields o...
    • How To Add A New Section To The ...
    • How To Display Custom Fields In ...
    • How to Show/Hide Fields Based On...
    • How To Set Repeat Rules On The C...

Documentation/Checkout Field Editor for WooCommerce/How to Add a New Custom Validation Rule?

How to Add a New Custom Validation Rule?

Last updated on September 21, 2022

Custom validator features can be used to define custom validation rules using RegEx which can be selected from the ‘Validations’ drop-down when creating or editing checkout fields.

custom-validator-new-cfe.png

Example:

custom_validator.png

To create new custom validators,

  1. Go to Dashboard → WooCommerce → Checkout Form → Advanced Settings page. You can see a section Custom Validators with 4 fields showing Validator Name, Validator Label, Validator Pattern, and Validator Message.
  2. Fill in the fields according to your requirements. Enter the regular expression to be validated in the Validator Pattern field.
  3. Click on the Add New Validator button to get a new validator settings row.
  4. Enter the validator settings.
Validator Name A unique name for the validation rule, which will be used internally to identify the validator.
Validator Label The display name for the validation rule.
Validator Pattern A regular expression is used to match a valid input. Eg : /^[0-9]{5}$/. The regular expression must be prefixed with /^ and suffixed with $/.
Error Message The message to be displayed when the validation fails. Use %s to include field names in validation messages.
  1. Save Changes.
  2. Newly created validators will be available to choose in the Validations drop-down.

validators_down_drop.png


This article posted in Advanced Settings, Checkout Field Editor for WooCommerce, Pro Documentation

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

ThemeHigh

We develop innovative WordPress plugins and themes for e-commerce and other WordPress websites.

Resources
  • Documentation
  • Support
  • Blog
  • Bestsellers
  • Affiliates
  • Partners
Policy Information
  • Terms & Conditions
  • Privacy Policy
  • Support Policy
  • Refunds Policy
  • Licenses
Security
Payment Options

© 2025 ThemeHigh. All rights reserved.

Terms and conditions, features, support, pricing, and service options subject to change without notice.