Custom Validation Rules in WooCommerce Checkout Field Editor
Make easy customisations to your checkout form with Checkout Field Editor for WooCommerce plugin. Add, edit, modify, delete, or change the display order of checkout fields with this easy WooCommerce checkout manager. Besides adding custom fields, create and include custom sections to your WooCommerce checkout form. Functioning hand-in-hand with the WooCommerce Multistep Checkout plugin from ThemeHigh, create custom checkout steps and include custom fields and sections to these steps using the Checkout Field Editor
Custom validator feature can be used to define custom validation rules using RegEx which can be selected from 'Validations' drop-down when creating or editing checkout fields. To create new custom validators,
- 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.
- Fill the fields according to your requirements. Enter the regular expression to be validated in the Validator Pattern field.
- Click on Add New Validator button to get new validator settings row.
- 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 which is used to match a valid input.
- Error Message: The message to be displayed when the validation fails. Use %s to include field name in validation messages.
- Save Changes.
- Newly created validators will be available to choose in Validations drop-down.

- Done.
Comments
Post a Comment