Field Validation

You can apply a custom validation rule for form fields in WordPress so that the form submission entries meet a certain criterion that you want. 

MetForm, Elementor contact form builder, comes with a Field Validation feature that helps you set form validation in WordPress.

Conditions préalables:  #

To add the Field Validation for your WordPress forms, you need to have the following plugins installed on your WordPress site:

How to add form validation in WordPress #

With any form created with MetForm, you can add a validation rule to each of the form fields. Follow the steps.

ÉTAPE 1: Create a new form or open any old form

Create a new form old choose any old form

ÉTAPE 2: Open the form in the Elementor editor

ÉTAPE 3: Under the content tab, open the Section Paramètres, and you’ll see the Validation taper.

    Pour le Name field, let’s see what validation types you’ll get –

    • By character length: It lets you set a strict minimum or maximum limit on the total number of individual characters. Its job is to make sure a user’s answer is not too short or too long. For example, it forces a user to use at least 8 characters for a name or stops them from typing more than 100 characters in a title.
    • By word length: Here, you can limit the total number of separate words users write. It checks that the user’s answer has enough words, or not too many. Like, if you set the answer limit to at least 5 words long, then users have to input accordingly.
    • By expression based: This rule dictates that the input must consist of one or more alphabetic letters (both uppercase A-Z and lowercase a-z). For example, it can enforce a specific data structure, like making sure an entry is a correctly formed email address.
    Different form validation types

    Here is another example, say, you’ve selected By character length for the phone number field. Usually, the valid phone numbers are 10 to 12 digits (based on the country code). So you can add a form validation rule where the minimum character length for the phone number will be 10, and the maximum character length will be 12.

    Add form validation in WordPress

    That’s it. You have set a field validation rule in the WordPress form.

    Now, if a user enters a phone number that is less than 10 digits or more than 12 digits, the form will show an invalid warning to the user.

    Like Field Validation support, MetForm comes with tons of advanced form features for WordPress. It is the most flexible Elementor contact form builder that lets you build faster, smoother, and better.

    Quels sont tes sentiments

    Updated on octobre 2, 2025