Confirm field validators come in handy while there is a particular field that is to be compared with another field to ensure they match. This feature helps to validate two fields for the same value (for example Email and Confirm Email) while adding products to the cart.
This validation is assigned to any particular field which will be verified and validated before adding products to the cart.
To create confirm validators:
- Navigate to the Advanced Settings tab (WooCommerce → Extra Product Option → Advanced Settings)
- From the section Custom validators, create new Confirm field validators by providing all the required values.
Example:
- Validator Label
The display name for the validation rule.
- Field Name
The field in which the value has to be compared with.
- Validator Message
The message to be displayed when the validation fails. Use %s to include the field name in the validation message.
- Click on the Save changes button.
- The newly created validators will be available to choose from the Validations drop-down.
- Confirm field validators will trigger only when there is value in the confirmation field. So please mark the confirmation field as required.
- Validator Label
Comments
0 comments
Please sign in to leave a comment.