Reveal Divi Contact Form with a Button Click

Written by Dan Mossop

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:

Transform Your Divi User Experience with Ease!

Enhance user interaction on your Divi site by easily showing or hiding elements like contact forms with the Divi Show / Hide Button Module. Perfect for keeping pages clean and engaging, this module allows you to effortlessly toggle visibility of sections, rows, or modules with a single click.

About Dan Mossop

Dan is a Scottish-born web developer, now living in Brisbane with his wife and son. He has been sharing tips and helping users with Divi since 2014. He created Divi Booster, the first Divi plugin, and continues to develop it along with 20+ other Divi plugins. Dan has a PhD in Computer Science, a background in web security and likes a lot of stuff, 

2 Comments

  1. The show/hide button has a circular border when it appears or loads but has a square border after it's clicked on. Can you please help with instructions on how to correct the border so that the border is the same after it's clicked-on? I've searched the settings but am having trouble finding the correct setting to adjust. Thanks.

    Reply
    • Hey David, you can do this by first enabling:

      Show / Hide Button Settings > Design > Active Button > Use Custom Styles For Active Button

      Then setting the border radius for the clicked / "active" state at:

      Show / Hide Button Settings > Design > Active Button > Active Button Border Radius

      If you reset this option to the default then it should use the circular border set on the normal button state. Alternatively, you can enter the border radius you want on the button when clicked (setting it to 50% will give you fully rounded corners).

      There's a bit more info on the active button styles here:

      Styling the Divi Show / Hide Button when "Active"

      I hope that helps!
      Dan

      Reply

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 *.

We may earn a commission when you visit links on our website.

Latest Posts

Fade a Divi Image Module Edge into the Background

Want to create a stylish fade effect on your Divi image module—where one side fades smoothly into the background? With a bit of CSS, you can make any edge (or corner) of the image fade out: top, bottom, left, right, or even diagonally.Fade a Divi Image Module Edge...

Hide the Header and Footer in the Hello Elementor Theme

Removing the default header and footer from your Hello Elementor theme allows for a streamlined and distraction-free website design. This is especially useful when creating unique landing pages, full-width layouts, or custom headers and footers with a page builder. In...

Setting up the Divi Password Box Module

Setting up password protection on a page can help you control access to sensitive or private content in WordPress, allowing only authorized visitors to view certain sections. With the Divi Password Box module, you can replace the plain Divi password form with a fully...

Open Divi Social Media Icons in a New Tab

Ensuring your website's social media icons open in a new browser tab creates a seamless user experience and keeps visitors engaged with your site while allowing them to explore your social media presence. This approach prevents users from navigating away from your...

Set Hover Color for Menu Links in the Divi Menu Module

Customizing the hover color of menu links lets you enhance the user experience and maintain visual consistency with your website’s brand. By setting a specific hover color, you can guide visitors' attention and improve navigation feedback. In this guide we show you...

Random Posts