Skip Navigation

[Resolved] Test radio buttons/checkbox in wpv-conditional. Documentation not clear

This support ticket is created 4 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by jeffS-2 4 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#1592153

Tell us what you are trying to do?
I have 3 radio buttons: Red, Green, Blue and are assigned values 1, 2, 3, respectively. If I want to test them in wpv-conditional, is it like this:
if="( $(wpcf-xxxx) eq 2 )"
Or is it like this:
if="( $wpcf-xxxx) eq '2' )"

Is there any documentation that you are following?
Documentation is contrdictory. In one place it says constants should be quoted, but in another place it says numbers should not be quoted. So, not 100% clear.

And in the Custom Fields page for a custom post, when setting a field conditional display manually (Advanced) it appears checking for radio buttons and checkboxes you should not use quotes for numbers like these. Confusing.

Thanks,
Jeff
–––––––

#1592689

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

As you can see with our Doc, the recommended way is:

[wpv-conditional if="( $(wpcf-budget) eq '50' )"] Your output [/wpv-conditional]

So, you should go with: if="( $(wpcf-budget) eq '2' )"

More info:
=> https://toolset.com/documentation/user-guides/views/conditional-html-output-in-views/

And in the Custom Fields page for a custom post, when setting a field conditional display manually (Advanced) it appears checking for radio buttons and checkboxes you should not use quotes for numbers like these. Confusing.
===>
If you are referring to the post field conditional display where you can add "Conditional display" for your custom field by adding a condition.

Please note that there are few types of post fields you cannot use as conditions for showing other fields. These fields include the Embedded Media, File Fields (Audio, Video, Image and File Upload field), Multiple Checkboxes field and a WYSIWYG Text Area field.

So, you can set the condition based on your radio field but not based on your checkboxes field as its not supported.

#1593353

My issue is resolved now. Thank you!