Validations are the basic requirements for any forms. They are essential to ensure that the users who fill up the forms and submit their data on your website are not entering wrong data. The required field validation is required

How to enable validations for a custom field

To enable validations on a custom field navigate to Dashboard >> Tevolution >> Custom fields >> Select the post type >> Edit the custom field you want to set validation for.

On turning on the toggle button for the validation field, the option for validations will appear. The following validations are available that you can select from the dropdown:

Require : To mark the field as mandatory. The user cannot leave this field blank.

Phone : To enter a phone number.

Digits : All the values entered should be numbers. No characters or special symbols allowed.

Email : The entered value should be in e-mail format. The format check will run a test to see that the email entered is in correct format.

Setting the validation error message.

With this you can set the message that is shown to the user when a required field is left empty. An ideal message should be short and descriptive to let the users know why the field cannot be left empty.

Use

In a medical Directory the registration form for the patients, it is necessary for them to mention their blood group and the disease name. The appointment confirmation message will be sent by an SMS, therefore it is also mandatory to enter the phone number too. For this the phone validation can be used.