WordPress.org

Forums

Contact Form 7
Hiding an entire Contact Form (2 posts)

  1. J M
    Member
    Posted 2 years ago #

    Hi.
    I've seen the following thread about hiding specific fields (http://wordpress.org/support/topic/plugin-contact-form-7-this-is-how-to-showhide-fields-with-jquery?replies=35) but I'm more interested in hiding the entire form, as I want to have several on the same page, and don't want them taking up lots of space. I have already got a working Javascript for showing/hiding divs, but it doesn't seem to work with the Contact Form shortcode. Any help?
    Here's the code I'm using:

    <script type="text/javascript">
    	function showStuff(id) {
    		document.getElementById(id).style.display = 'block';
    	}
    	function hideStuff(id) {
    		document.getElementById(id).style.display = 'none';
    	}
    </script>
    <p><a href="#" onclick="showStuff('answer3'); return false;">Vote for your favourite Albums/E.P.s of 2012</a><br>
    <span id="answer3" style="display: none;">[contact-form-7 id="2881" title="Vote for your favourite UK Hip Hop albums or E.P.s of 2012"]
    <a href="#" onclick="hideStuff('answer3'); return false;">Close this form</<>
    </span></p>

    However, the form still shows up in full. I've checked for errors in the code by replacing the [shortcode] with a single line of text and it works. I'm not too familiar with Javascript, but worked it out this far by myself. Can anybody help?
    Page in question is here: http://hiphopinenglish.com/vote-for-your-favourites.
    Thanks

    http://wordpress.org/extend/plugins/contact-form-7/

  2. davejampole
    Member
    Posted 2 years ago #

    Take a look at the Collapse-O-Matic plugin from <http://plugins.twinpictures.de/>. I just it throughout two of my sites and it is solid and VERY flexible. Take a look at <www.arklatexmoaa.org> and you will see read more at the bottom of the right-hand widget area. Also, on the left-hand widget, towards the bottom of the Newsletter Archives, you can see another implementation In the External Resources section (right hand side) I use it again.

    Very good documentation and versatile.

    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic