Divi’s Contact Form shows the same fixed error texts on every form, such as “Please, fill in the following fields:” followed by the field titles, and marks bad fields with a red border you can’t change. With Error messages on, you write your own texts for each form and for each field, and style the error box and the invalid fields with Divi’s design options.
Switch it on
- Go to Divi Doctor → Features.
- Under Contact Form module, find the Error messages card and click Enable.
Every Divi 5 Contact Form now has an Error Messages group in its Content tab, and Error Message and Invalid Fields groups in its Design tab. Each field of the form has an Error Message option too. A form keeps Divi’s texts and look until you set something.
Write the form’s texts
- Open the page in the Visual Builder and open the Contact Form’s settings.
- In the Content tab, open Error Messages.
- Type your text into the messages you want to change, for example
Please fill in:in Missing Fields. - Save the page, and clear any page cache.
Leave a message empty to keep Divi’s text. Each option’s help text in the builder shows Divi’s text for that message.
| Option | When it shows | Divi’s text |
|---|---|---|
| Missing Fields | The heading above the list of required fields the visitor left empty. | Please, fill in the following fields: |
| Other Errors | The heading above the other errors, such as an invalid email or a wrong captcha. Divi only shows it when there are missing fields too. | Please, fix the following errors: |
| Invalid Email | An email field holds an address that isn’t valid. | Invalid email |
| Wrong Captcha | The captcha answer is wrong. Your text replaces both Divi’s browser message and the message Divi shows after sending (“Make sure you entered the correct captcha.”). | You entered the wrong number in captcha. |
| Spam Check Failed | The spam protection service rejected the message. | You must be a human to submit this form. |
| Sending Failed | Divi couldn’t send the email. | There was an error trying to send your message. Please try again later. |
The texts are plain text: HTML is removed, and line breaks and extra spaces become single spaces. Each option has one value for all screen sizes.
Give a field its own message
Divi lists a missing field by its title, so a field titled “Phone” shows up as “Phone”. To say something clearer, give the field its own message:
- In the Contact Form’s settings, go to Content → Elements and open the field.
- In Content → Field Options, type the text into Error Message, for example
Please add a phone number we can call you on. - Save the page.
The field’s message is used instead of:
- its title in the list of missing fields, when the visitor left it empty;
- “Invalid email” (or the form’s Invalid Email text), when it’s an email field with an address that isn’t valid;
- the message Divi shows for that field after sending, such as “Phone: The value may only contain numbers.”. This covers Divi’s messages for a required field, a value that isn’t one of the field’s options, a value with characters the field doesn’t allow, a value that’s too long or too short, and an invalid email address.
Fields without an Error Message keep Divi’s text.
Style the errors
In the Contact Form’s Design tab, two groups hold Divi’s own design options:
| Group | What it styles | Options |
|---|---|---|
| Error Message | The box with the error list or message. | Text, Background, Spacing, Border and Box Shadow |
| Invalid Fields | The border of each field Divi marks as missing or invalid, instead of Divi’s red border. Checkboxes and radio buttons get it on their box. | Border |
Divi’s style engine builds the CSS, so your global colors are available, tablet and phone values work, and values saved in a Contact Form preset apply. The Error Message design applies to the box only while it shows an error. Divi uses the same box for the success message, which keeps its own look; to style that, see Success message design.
The builder doesn’t preview these designs or the error texts; the messages only appear on the live page. See Check your messages.
How the texts are swapped in
Divi checks the form exactly as before. Divi Doctor only changes the words and the look of what Divi shows:
- Before sending, Divi checks required fields, email addresses and the captcha in the browser and writes its error list. Right after that, Divi Doctor’s script replaces Divi’s headings and items with your texts, in the same order.
- After sending, the server can still refuse the message, for example when the spam protection service rejects it or the email can’t be sent. Divi shows one such message at a time. Divi Doctor recognizes it and puts your text in its place in the page Divi sends back.
An empty captcha is listed as Captcha, Divi’s own word, at the end of the missing fields. That item isn’t changed.
What it adds to the page
- A small deferred script (about 3 KB), only on pages with a form that uses your browser texts, a design or a field Error Message. Forms that only set Spam Check Failed or Sending Failed don’t need it, because those messages are replaced on the server.
- Your texts, as attributes on the form and its fields.
- One style block at the end of the page with the CSS of the forms that use the designs.
A form that only appears later on the page, for example in a popup, gets your texts too.
Check your messages
- Set a Missing Fields text and a field’s Error Message, save the page and clear any page cache.
- Open the page in a private window, so you’re logged out.
- Press the form’s submit button with the form empty. Your heading appears above the list, with the field’s own message in it.
- Give Design → Error Message a background color, save, and try again to see the design.
Limits
- Divi 5 Contact Form and Contact Field modules only.
- Divi shows one server error at a time. The Spam Check Failed and Sending Failed texts come from the server, so they only appear after the form was sent.
- Divi’s messages after sending name the field by its title. If two fields in the form have the same title, Divi Doctor can’t tell which one Divi meant, so neither field’s own message is used for those messages.
- If Divi’s list of missing fields doesn’t match the empty fields one to one, the titles are left as Divi wrote them.
- Nothing changes how Divi validates or sends the form.
Turning it off
With Error messages off, forms show Divi’s error texts and red borders again. The texts and designs you set stay saved in each form and field, and come back when you turn the feature on again.
Questions
How do I change the Contact Form error message in Divi 5?
Switch on Error messages in Divi Doctor → Features, then open the Contact Form’s settings and type your own texts in Content → Error Messages. Divi Doctor is a plugin for Divi 5, and its features are off by default. You can replace Divi’s fixed texts, such as “Please, fill in the following fields:”, on each form. Leave a message empty to keep Divi’s text, then save the page and clear any page cache.
Can I give each Contact Form field its own error message in Divi 5?
Yes. With Error messages on, every field of a Divi 5 Contact Form has an Error Message option in Content → Field Options. Divi lists a missing field by its title, and your message is used instead of that title. On an email field it also replaces “Invalid email”, and it replaces Divi’s message for that field after sending. Fields without an Error Message keep Divi’s text.
How do I change the red border on invalid Contact Form fields in Divi 5?
Use the Invalid Fields group in the Contact Form’s Design tab, which appears once Error messages is on in Divi Doctor → Features. Its Border option replaces Divi’s red border on each field Divi marks as missing or invalid; checkboxes and radio buttons get it on their box. Divi’s style engine builds the CSS, so global colors, tablet and phone values and presets all work.
Why don’t my custom Contact Form error messages show in the Divi builder?
The builder doesn’t preview the error texts or their designs; the messages only appear on the live page. To check them, save the page, clear any page cache and open the page in a private window, so you’re logged out. Press the form’s submit button with the form empty. Your heading appears above the list of missing fields, with each field’s own message in it.
Does changing the error messages affect how Divi validates the Contact Form?
No. Divi checks the form exactly as before, and nothing changes how Divi validates or sends it. Divi Doctor only changes the words and the look of what Divi shows. Before sending, its script replaces Divi’s error list in the browser with your texts. After sending, it puts your text in place of a server message such as Spam Check Failed or Sending Failed.
Do my Contact Form error texts stay saved if I turn the feature off?
Yes. With Error messages off, forms show Divi’s error texts and red borders again, but the texts and designs you set stay saved in each form and field. They come back when you turn the feature on again in Divi Doctor → Features.
To change the message visitors see after a successful send, see Success message design. For the Date Picker and File Upload fields’ own messages, see Date picker and file upload fields.