Hi,
[select* Telefoon “– Kies uw telefoon –” “Iphone” “Samsung” “Huawei” “Sony” “Overig”]
then
Try this Conditional: show [Telefoon] if [Soorttoestel] equals “Telefoon”.
I’m not actively supporting the Material Design plugin. I’m willing to work with the author of the plugin to solve the issue, but I cannot possibly test all CF7 extensions and adapt mine to work with all of them.
Hi,
I removed Material Design Plugin:
Uw naam (verplicht)
[text* your-name]
Uw email (verplicht)
[email* your-email]
Uw toestel
[select* Soorttoestel “—Kies uw Toestel—” “Telefoon” “Tablet” “Laptop”]
[group phone]
[select* phone “– Kies uw telefoon –” “Iphone” “Samsung” “Huawei” “Sony” “Overig”]
[/group]
Aanvullende informatie
[textarea* your-message]
[submit “Verstuur”]
with condition:
show [phone] if [Soorttoestel] equals “Telefoon”
The group is not showing…
I also get an error in the console:
Uncaught SyntaxError: Unexpected end of JSON input in scripts.js of the plugin:
row 20: form_options = JSON.parse(value);
-
This reply was modified 7 years, 8 months ago by
cellumer.
you cannot have the same name for groups or fields in your form. You have group named phone and a field named phone, please change one of these to something else and then verify your conditions again.
I did change it:
Uw naam (verplicht)
[text* your-name]
Uw email (verplicht)
[email* your-email]
Uw toestel
[select* Soorttoestel “—Kies uw Toestel—” “Telefoon” “Tablet” “Laptop”]
[group phone]
[select* tel “– Kies uw telefoon –” “Iphone” “Samsung” “Huawei” “Sony” “Overig”]
[/group]
Aanvullende informatie
[textarea* your-message]
[submit “Verstuur”]
AND
show [phone] if [Soorttoestel] equals “Telefoon”
This is also not working, I have the same error.
I found the error, but I’m afraid it might be a tough one to debug.
The problem is that the value attribute of the hidden _wpcf7cf_options field is not escaped. It now looks like this:
<input type="hidden" name="_wpcf7cf_options" value="{"form_id":9,"conditions":[{"then_field":"phone" ..." />
but it should look like this:
<input type="hidden" name="_wpcf7cf_options" value="{"form_id":9,"conditions":[{"then_field":"phone" ..." />
Conditional fields uses a CF7 filter wpcf7_form_hidden_fields to add the hidden field. This filter in it’s turn will call the native wordpress function esc_attr to make sure the attribute is escaped properly. The esc_attr function (wp-includes/formatting.php line 3976) applies another filter called attribute_escape. So, you see, there are a couple if filters exposed where other plugins or your theme might be modifying the flow, causing the attribute not te be escaped.
The best way to figure out which plugin (or theme) is responsible for this, it’s best to disable all your plugins (except CF7 and Conditional fields) and your theme, and hopefully the problem should be gone. Then start, re-enabling plugins until you figure out which plugin causes the issue.
Good luck! and sorry for the late reply