Validate field inputs using Confirm Validators
Confirm Field Validators feature is used to validate two fields for the same value (for example: Name and Confirm the Name) when adding a product to the cart. This validation is assigned to any particular field which will be verified and validated before adding the product to the cart. To create a new confirm validator,
- Go to Extra Product Options >> Advanced Settings tab. You can see a section Confirm Field Validators with 4 fields showing Validator Name, Validator Label, Field Name and Validator Message.
- Fill the fields according to your requirements. In the Field Name box, give the name of the first field with the value which should be equal for the field on which the validation is to be applied. (For example, if the values entered in the fields sleeve_size and belt_size should be same, give ‘sleeve_size’ as Field Name.)
- To add more than one field validator, click on the ‘Add New Validator’ (+) button to get a new row where you can add further.
- Save the modifications clicking on the ‘Save the changes’ button.
Input Values for Confirm Field Validator Fields Validator Name: Provide a unique name (combination of letters and numbers without space) for the validation rule, which will be used internally to identify the validator. Validator Label: The name provided here will be the display name for the validation rule. Field Name: In this field, give the name of the first field with the value which should be equal for the field on which the validation is to be applied. Validation Message: Provide the message to be displayed when the validation fails. Use %s: to include field name in the validation messages.
- Once the field validator is successfully created and updated, you can go to the Product Options tab and edit/add a product field. Here, you can choose the validator from the Validations pulldown field.