Reveal Divi Contact Form with a Button Click

|

Divi includes a contact form module that lets you add an email contact form to a page. Here's how to hide the contact form until a "Contact Us" button is clicked.

Add a Contact Us Button with Divi Show / Hide Button Module

Divi Show / Hide Button module makes it easy to reveal and hide Divi Builder elements (sections, rows, modules, etc.) on the click of a button. This can be used to quickly set up a "Contact Us" button which, when clicked by the user, reveals a contact form.

To create a contact button and initially hidden contact form:

1. Add a contact form module to the page, if you haven't already:

2. Go to "Contact Form Settings > Advanced > CSS ID & Classes > CSS Class" and enter an ID for the contact form, for instance "hidden-contact-form": 

3. Add a Show / Hide Button module to the page:

4. Set the Show / Hide Button text at "Show / Hide Button Settings > Content > Text > Button". For example, you may want to use "Contact Us", "Get in Touch", "Show Contact Form", etc.

5. Configure the Show / Hide Button to show the contact form when clicked, by entering the ID of the contact form prefixed with a "#" character (e.g. "#hidden-contact-form") at "Show / Hide Button Settings > Content > When Button Clicked… > Show these Elements":

6. Configure the Show / Hide Button to hide the contact form initially, by entering the ID of the contact form prefixed with a "#" character (e.g. "#hidden-contact-form") at "Show / Hide Button Settings > Content > When Page Loads… > Hide these Elements":

7. Now if you save the page and view it on the front end, you should initially see only the "Contact Us" button. Click on this and the contact form should be revealed, e.g:

This post may contain referral links which may earn a commission for this site

Divi Booster

Hundreds of new features for Divi
in one easy-to-use plugin

0 Comments

Submit a Comment

Comments are manually moderated and approved at the time they are answered. A preview is shown while pending but may disappear if your are cookies cleared - don't worry though, the comment is still in the queue.

Your email address will not be published. Required fields are marked *.