pwkip / contact-form-7-conditional-fields

Wordpress Plugin: Contact Form 7 Conditional Fields
http://bdwm.be/wpcf7cf
22 stars 18 forks source link

=== Conditional Fields for Contact Form 7 === Contributors: Jules Colle Donate link: https://shop.bdwm.be/contact-form-7-conditional-fields-pro/ Author: Jules Colle Website: http://bdwm.be Tags: contact form 7, forms, form, conditional fields, conditional logic Requires at least: 5.0 Tested up to: 6.7 Stable tag: 2.5.2 Requires PHP: 7.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html

Adds conditional logic to Contact Form 7.

== Description ==

This plugin adds conditional logic to Contact Form 7.

If you edit your CF7 form, you will see an additional tag called "Conditional fields Group". Everything you put between the start and end tag will be hidden by default. After you have added the field group(s), go to the "Conditional fields" tab to create one or more conditions that will make the group(s) appear.

= How to use it =

Follow this tutorial

== Main features ==

= Support for required fields =

Required fields inside hidden groups will never trigger validation errors.

= Hide/show info in emails based on what groups are visible =

Conditional groups can now be added to the emails as well. Just wrap the content with [group-name] ... [/group-name] tags.

= Groups can be nested = Groups can be nested, both in the form and in the email

Example form: [group group-1] [group group-inside-1] ... [/group] [/group]

Example email: [group-1] [group-inside-1] ... [/group-inside-1] [/group-1]

= Advanced =

Advanced users can code up the conditions as plain text instead of using the select boxes, using the Text View.

== Need more power? ==

Just like WordPress, the power of Contact Form 7 lies in its rich eco-system of extensions that build on top of it. However, it can be difficult to find a set of complex extensions that work well together.

That's why I created Conditional Fields Pro. It adds some powerful features to Contact form 7 and guarantees that everything will run smoothly with Conditional Fields.

Pro features include:

Get the PRO version of Conditional Fields for Contact Form 7!

== Installation ==

Please follow the standard installation procedure for WordPress plugins.

Follow this tutorial if you are not sure how to use the plugin.

== Frequently Asked Questions ==

= Email message is not showing the correct values / Wrong values are submitted =

All field names should be unique

Even though your fields might never show up at the same time, it is still important to realize that WPCF7CF will not remove the fields, it merely hides them. So all fields will be submitted when the form is sent. Because of this no two fields can have the same name.

Incorrect form (2 input elements having the same name "a"): [group group-1][select a "1" "2" "3"][/group] [group group-2][select a "1" "2" "3"][/group]

Correct form (all groups and fields have unique names): [group group-1][select a "1" "2" "3"][/group] [group group-2][select b "1" "2" "3"][/group]

= All my groups show up all the time and never get hidden. =

Reason #1: Javascript error Check your browser console (F12) for any javascript errors. WPCF7CF loads it's scripts at the bottom of the HTML page, so if some javascript error gets triggered before that, the code will not be executed in most browsers. Before reaching out to the support forum try to determine which plugin or theme is causing the problem, by gradually disabling plugins and changing theme.

Reason #2: wp_footer() isn't loaded Check if your theme is calling the wp_footer() function. Typically this function will be called in your theme's footer.php file. The conditional fields javascript code is loaded during wp_footer, so a call to this function is crucial. If there is no such call in your theme, go to your theme's footer.php file and add this code right before the closing </body> tag: &lt;?php wp_footer(); ?&gt;

== Screenshots ==

  1. Conditional fields in action
  2. Defining rules to show/hide groups of input elements in the backend interface

== Upgrade Notice ==

= 2.0 =

Make sure to also update CF7 to the latest version! (Version 2.0 is only compatible with CF7 versions 5.4 and up. Version 1.9.16 is only compatible with CF7 version 5.3.*)

= 2.2 =

Make sure to also update CF7 to the latest version! (Version 2.2 is only compatible with CF7 versions 5.6 and up. Version 2.1.6 is only compatible with CF7 version 5.5.*)

= 2.2.10 =

Because the nature of the changes introduced in version 5.7 of Contact Form 7 you might need to make some manual changes to your forms and/or to your wp-config.php file. Please check the changelog. You could also wait for the release of version 5.7.1 of Contact Form 7. We hope the author will have address some of the issues by then.

= 2.2.11 =

Reverted autop-fix because it was causing addional errors. Bottom line: Make sure you are om Conditional Fields version 2.2.11 and CF7 version 5.6.4

== Changelog ==

= 2.5.2 (2024-11-27) =

= 2.5.1 (2024-11-03) =

= 2.5 (2024-10-22) =

= 2.4.15 (2024-07-27) =

= 2.4.14 (2024-07-18) =

= 2.4.13 (2024-06-29) =

= 2.4.12 (2024-05-25) =

= 2.4.11 (2024-05-12) =

= 2.4.10 (2024-03-30) =

= 2.4.9 (2024-03-30) =

= 2.4.8 (2024-03-14) =

= 2.4.7 (2024-02-13) =

= 2.4.6 (2024-01-15) =

= 2.4.5 (2023-12-19) =

= 2.4.4 (2023-12-10) =

= 2.4.3 (2023-11-23) =

= 2.4.2 (2023-11-22) =

= 2.4.1 (2023-11-16) =

= 2.4 (2023-11-13) =

= 2.3.12 (2023-10-27) =

= 2.3.11 (2023-10-03) =

= 2.3.10 (2023-08-07) =

= 2.3.9 (2023-05-31) =

= 2.3.8 (2023-04-23) =

= 2.3.7 (2023-04-13) =

= 2.3.6 (2023-04-11) =

= 2.3.5 (2023-03-24) =

= 2.3.4 (2023-02-19) =

= 2.3.3 (2023-01-26) =

= 2.3.2 (2022-12-28) =

= 2.3.1 (2022-12-17) =

= 2.3 (2022-12-16) =

= 2.2.11 (2022-12-13) =

= 2.2.10 (2022-12-11) =

= 2.2.9 (2022-10-19) =

= 2.2.8 (2022-10-14) =

= 2.2.7 (2022-10-14) =

= 2.2.6 (2022-09-08) =

= 2.2.5 (2022-09-04) =

= 2.2.4 (2022-09-01) =

= 2.2.3 (2022-08-10) =

= 2.2.2 (2022-08-07) =

= 2.2.1 (2022-07-21) =

= 2.2 (2022-06-17) =

= 2.1.6 (2022-06-07) =

= 2.1.5 (2022-05-22) =

= 2.1.4 (2022-05-16) =

= 2.1.3 (2022-04-18) =

= 2.1.2 (2022-02-23) =

= 2.1.1 (2022-02-14) =

= 2.1 (2022-01-27) =

= 2.0.9 (2022-01-20) =

= 2.0.8 (2021-11-28) =

= 2.0.7 (2021-10-26) =

= 2.0.6 (2021-10-26) =

= 2.0.5 (2021-10-13) =

= 2.0.4 (2021-07-19) =

= 2.0.3 (2021-05-02) =

= 2.0.2 (2021-04-06) =

= 2.0.1 (2021-03-31) =

= 2.0 (2021-03-29) =

= 1.9.16 (2021-03-09) =

= 1.9.15 (2021-03-03) =

= 1.9.14 (2020-10-03) =

= 1.9.13 (2020-09-28) =

= 1.9.12 (2020-09-24) =

= 1.9.11 (2020-09-07) =

= 1.9.10 (2020-08-19) =

= 1.9.9 (2020-07-29) =

= 1.9.8 (2020-07-20) =

= 1.9.7 (2020-07-07) =

= 1.9.6 (2020-07-04) =

= 1.9.5 (2020-07-01) =

= 1.9.4 (2020-06-23) =

= 1.9.3 (2020-06-21) =

= 1.9 (2020-06-21) =

= 1.8.7 (2020-06-01) =

= 1.8.6 (2020-04-18) =

= 1.8.5 (2020-04-17) =

= 1.8.4 (2020-03-05) =

= 1.8.3 (2020-03-01) =

= 1.8.2 (2020-02-27) =

= 1.8.1 (2020-02-23) =

= 1.8 (2020-02-03) =

= 1.7.9 (2020-01-22) =

= 1.7.8 (2019-11-26) =

= 1.7.7 (2019-11-05) =

= 1.7.6 (2019-11-01) =

= 1.7.5 (2019-10-31) =

= 1.7.4 (2019-10-29) =

= 1.7.3 (2019-10-24) =

= 1.7.2 (2019-10-24) =

= 1.7.1 (2019-10-23) =

= 1.7 (2019-10-18) =

= 1.6.5 (2019-10-15) =

= 1.6.4 (2019-07-04) =

= 1.6.3 (2019-07-04) =

= 1.6.2 (2019-06-25) =

= 1.6.1 (2019-06-03) =

= 1.6 (2019-06-01) =

= 1.5.5 (2019-05-20) =

= 1.5.4 (2019-05-06) =

= 1.5.3 (2019-05-03) =

= 1.5.2 (2019-05-03) =

= 1.5.1 (2019-05-02) =

= 1.5 (2019-04-21) =

= 1.4.3 (2019-04-12) =

= 1.4.2 (2019-04-10) =

= 1.4.1 (2018-08-21) =

= 1.4 (2018-08-15) =

= 1.3.4 =

= 1.3.3 =

= 1.3.2 =

= 1.3.1 =

= 1.3 =

= 1.2.3 =

= 1.2.2 =

= 1.2.1 =

= 1.2 =

= 1.1 =

= 1.0 =

= 0.2.9 =

= 0.2.8 =

= 0.2.7 =

= 0.2.6 =

= 0.2.5 =

= 0.2.4 =

= 0.2.3 =

= 0.2.2 =

= 0.2.1 =

= 0.2 =

= 0.1.7 =

= 0.1.6 =

= 0.1.5 =

= 0.1.4 =

= 0.1.3 =

= 0.1.2 =

= 0.1.1 = Fixed bug with exclusive checkboxes (https://wordpress.org/support/topic/groups-not-showing)

= 0.1 = First release