pwkip / contact-form-7-conditional-fields

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

Same field name in different groups #99

Closed AlexanderFlyingAcademy closed 1 year ago

AlexanderFlyingAcademy commented 2 years ago

Hello. I'm trying to make a really simple form.

I have set of fields, but I'm using conditional logic to get more qualified leads. So, my question is following: How can I use same field name in groups?

For example, I have form like this:

[md-form]

[md-text label="First name"]
[text* fname]
[/md-text]

[md-text label="Last name"]
[text* lname]
[/md-text]

[md-text label="Email"]
[email* email]
[/md-text]

[md-text label="Phone"]
[phonetext* phone placeholder numberonly "+..."]
[/md-text]

[md-select label="Where you want to study"]
[select* license include_blank "USA" "Europe" "India"]
[/md-select]

[group training]
[md-select label="Type of training"]
[select* trainingtype include_blank "Professional Program" "Individual Course"]
[/md-select]
[/group]

[group group-eu-professional]
[md-select label="Select course"]
[select* **interest** include_blank "first option"
"second option"]
[/md-select]
[/group]

[group group-us-professional]
[md-select label="Select course"]
[select* **interest** include_blank "First option" "Second option" ]
[/md-select]
[/group]

[group group-in-professional]
[md-select label="Select course"]
[select* **interest** include_blank "one option+"]
[/md-select]
[/group]

[md-submit]
[submit "Send"]
[/md-submit]

[/md-form]

The problem here is that I need to have same name for a select input (interest), but with conditional logic I display only one of them. But I'm receiving the empty value for a field, because CF7 takes only first option.. Is there any way to fix this logic?

pwkip commented 1 year ago

You should use disable_on_hide if you want to use the same field name multiple times. https://conditional-fields-cf7.bdwm.be/disable_on_hide/