Support » Plugin: Contact Form 7 » Hiding an entire Contact Form

  • J M


    I’ve seen the following thread about hiding specific fields ( 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';
    <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</<>

    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:

Viewing 1 replies (of 1 total)
  • Take a look at the Collapse-O-Matic plugin from <;. I just it throughout two of my sites and it is solid and VERY flexible. Take a look at <> 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Hiding an entire Contact Form’ is closed to new replies.