Hiding an entire Contact Form
-
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
- The topic ‘Hiding an entire Contact Form’ is closed to new replies.