Skip Navigation

[Resolved] Can't have multiple conditional read in CRED

This support ticket is created 2 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by catherineB 2 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#2357233

My first taxonomy liste all 10 canadian provinces.
Then, once a user select a specific province, I want to display the specific city taxonomy.

So far I've tried to make 10 conditional display:
- If Quebec is selected, show region-qc (Quebec cities)
- If Ontario is selected, show region-on (Ontario cities)
- etc..

But it seems Toolset can only manage 3 conditional at the same time, as all others after the third one are not displaying properly.

Code is good, because if I take the 4th conditional and place it above all, CRED form will display it, and the previously "number 3th" will no longer be displayed (now "number 4th" conditional).

Is there a way I can make this simplier?

The code I use. The field region-ipe changes for each city taxonomy (cities of Quebec, Ontario...)
[cred_show_group if="($(pays-provinces) eq '3584' )" mode='fade-slide']
<div class="cred-label">[wpml-string context="cred-logement"]Région[/wpml-string]</div>
[cred_field field='region-ipe' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-ipe_add_new" taxonomy="region-ipe" type="add_new"]
</div>
[/cred_show_group]

#2358567

Hello,

Toolset Forms plugin can handle multiple conditions(4 or more), there might be some server issues in your website, please try to get the PHP/JS debug logs from your website:
1) Make sure you are using the latest version of Toolset plugins, you can download them here:
https://toolset.com/account/downloads/

2) Also check if there is any PHP/JS error in your website:
https://toolset.com/documentation/programmer-reference/debugging-sites-built-with-toolset/

#2365205

HI Luo, sorry for late reply

I've succeeded to do 17 conditionals in a row for some taxonomies (all sub-divisions of Quebec province), but I still couldn't make more than 3 conditionnals in a row for other taxonomies. The moment I would add the 4th code, I would get a red </div> at the end.

But then, comparing both codes, I realised I was missing one <div> opening line at the beginning
<div class="cred-field cred-field-districs">

So that can explain why I would get a red </div> at the end of the code.
But I don't understand why the 4th code would create a <div> issue because it wasn't related in any way to the 3 previous as all codes were always inside individual conditional brakets [].

This said, now it works 🙂

#2365331

It works, thanks 🙂