简体   繁体   中英

show/hide fields with jQuery on contact form 7 plugin

Please refer to BunnyBomb article https://wordpress.org/support/topic/plugin-contact-form-7-this-is-how-to-showhide-fields-with-jquery

I have followed this however when I add the code to my header.php inside a <head> tag(STEP 5) it all messes up and my website does not display properly but the form works.

This is the code that messes it up (yes the folder directories are right, I moved them about to suit my folder structure):

<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/assets/js/1.7.1/jquery2.min.js"></script>
<script type="text/javascript" src="<?php echo get_stylesheet_directory_uri(); ?>/assets/js/hidefieldsScript2.js"></script>

If I take it all out my website works fine but my contact form doesn't.

How can I solve this so both my website and contact form works?

Ive solved my own problem -- i went onto the contact form 7 plugin on wordpress. opened the contact form in form view and added the scripts to the top - i didnt need to add a tag.

you have to remember to change the source to something like this src="http://YOURSITE.com/wp-content/themes/YOURTHEME/....(the javascript files)"

HOPE THIS HELPS!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM