Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist:
Contact Form 7 Validation With Custom Error Messages | WP Learning Lab
You can use the Contact Form 7 validation plugin to add custom error messages to all of your Contact Form 7 fields. This will greatly improve user experience with your contact forms.
Why do you need custom error messages?
Because a default contact form 7 error message is just "this field is required".
Which is okay for some cases, but usually it's not enough information. This is especially true if you are creating a long and complicated form.
When a user encounters an error the error message needs to give them information on how to resolve the problem.
Luckily, there's a plugin for that.
To install this plugin please log into your WordPress dashboard, hover over Plugins and then click on Add New.
On the next page type "Contact Form 7 Custom Validation" into the search bar. The plugin we want should be the first one in the top left.
Click on the Install Now button and then click Activate after it's installed.
Now head over to the editor of your contact form.
In the list of tabs (Form, Mail, Messages, Additional Settings) click on the Messages tab.
You will see a list of messages you form can create when certain situations are encountered. With this Contact Form 7 Custom Validation plugin you can create custom error messages for any field.
Simply find the field name in the list on the Messages tab and then replace the error message in the input field with your own custom error message.
Fields that existed before the plugin was installed will be available to edit in the Message tab right away.
If you are creating new fields in your form then the option to create error messages for those fields won't be available until you save the form.
Once you save the form you will find the new custom error message fields using the name of the field for reference.
By going through the process of Contact Form 7 validation and custom error messages you will be providing an enhanced user experience for your visitors.
At the end of the day, that's better for everyone.
I hope this information helps you! If you have any questions leave a comment below or ping me on Twitter.
--------------
If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.
Connect with us:
WP Learning Lab Channel:
Facebook:
Twitter:
Google Plus:
Pinterest: