Skip Navigation

[Resolved] Conditional output in a CRED form

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

Problem: I'm using wpv-conditional tags in a CRED Form but they do not seem to be working as expected.

Solution: Rewrite these conditionals using CRED conditional groups. The wpv-conditional tag syntax is meant to be used in the context of a single post.

Relevant Documentation: https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/

This support ticket is created 6 years, 8 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by ruudd 6 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#680853

I am trying to:
If a submitter answers a question in a certain way, offer certain fields instead of others.

This is an example of the code in the CRED post form:

[wpv-conditional if="( $(wpcf-frequentie) eq 'Eenmalig' )"]
<div class="form-group">
Start Datum
[cred_field field='start-datum' post='markten' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[/wpv-conditional]

Link to a page where the issue can be seen:

hidden link

Below the heading DAG(EN) MARKT, you can find two options (Dutch language):
- Eenmalig
- Regelmatig

I expected to see:

Upon selecting ´Eenmalig´, I would´ve expect to see the field Start Date.

Instead, I got:

The field is hidden.

The concerning site is in staging phase and I made a full backup, so not much harm can be done.

#681147

Hi, it seems that the User you created for me to test with does not have the ability to access your CRED forms. Can you check the role and bump it up to Editor or Administrator?

#681264

Hello Christian,

Thanks for your prompt reply. I just promoted your rights. Please check again.

Kind regards,
Ruud

#681372
Screen Shot 2018-04-17 at 3.22.47 PM.png

Okay I see now, thanks. Instead of using wpv-conditional tags, you should use CRED conditional groups in a CRED form. I'm attaching a screenshot showing how to insert CRED conditional groups in the form editor. Please remove the wpv-conditionals and insert a new conditional group instead.

#683981

Hello Christian,

That did the trick. Thanks a lot.

Kind regards,
Ruud