Skip Navigation

[Resolved] Cred form conditional display not working as expected

This thread is resolved. Here is a description of the problem and solution.

Problem:

Display different fields depending on radio field input value.

Solution:

You can follow our document to setup the conditional codes:

Relevant Documentation:

https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/

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.

Our next available supporter will start replying to tickets in about 6.38 hours from now. Thank you for your understanding.

This topic contains 3 replies, has 2 voices.

Last updated by michaelR-26 4 months, 3 weeks ago.

Assigned support staff: Luo Yang.

Author
Posts
#1705961

Tell us what you are trying to do? I have two fields.

I am using the advanced form editor

<div class="col-md-6">[cred_field field="would-you-like-to-add-some-resort-stats" force_type="field" class="form-check-input" output="bootstrap"]</div>
<div class="col-md-6">[cred_show_group if="( $(would-you-like-to-add-some-resort-stats) eq '1' )" mode="fade-slide"]<div class="form-group"><label>Add the URL to your snow report</label> [cred_field field="snow-report" force_type="field" class="form-control" output="bootstrap"]</div>[/cred_show_group]</div>

In the first div is a check box, which if checked I would like to display the "snow-report" field in the second div.

#1706391

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

Hello,

You can follow our document to setup the conditional codes:
https://toolset.com/documentation/programmer-reference/forms/cred-conditional-display-engine/

I am not sure how do you setup the custom field "would-you-like-to-add-some-resort-stats", is it a custom checkboxes field or checkbox field?

If you need more assistance for it, please provide a test site with the same problem, also point out the problem page URL and form URL, I can setup a demo for you, private message box enabled.

#1707515

Luo Yang
Supporter

Languages: English (English ) Chinese (Simplified) (简体中文 )

Timezone: Asia/Hong_Kong (GMT+08:00)

I can see the problem in your website, I have tried below codes:

[cred_show_group if="( $(would-you-like-to-add-some-resort-stats) eq '2' )" mode="fade-slide"]1234[/cred_show_group]

It does not work in your website, but it works in my localhost with a fresh WP installation + the same field "would-you-like-to-add-some-resort-stats" in a simple post form, see video capature:
hidden link

So the problem is abnormal, please check these:
1) In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

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

3) If the problem still persists, please provide database dump file(ZIP file) of your website, you can put the package files in your own google drive disk, share the link only, I need to test and debug it in my localhost, thanks
https://toolset.com/faq/provide-supporters-copy-site/

#1707849

My issue is resolved now. Thank you!