Sauter la navigation

[Fermé] How to if a certain value in checkboxes field is set?

This support ticket is created Il y a 3 années et 4 mois. 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Ce sujet contient 3 réponses, a 2 voix.

Dernière mise à jour par Shane Il y a 3 années et 4 mois.

Assisté par: Shane.

Auteur
Publications
#2162813
image 2.jpg
Image 1.jpg

I have a group of custom fields and use the field "checkboxes" to store some maintenance data. See. image 1.

And then I need to output different content if the first checkbox is checked and if the second is; also a mix is possible.

But my conditional statement that I use in a "fields and text" block in a view that I define, does only works if the OR the other checkbox was checked, not when both are.

Any idea how to achieve this? Would help a lot!

Kind regards!

#2162893

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Martin,

Thank you for getting in touch.

Ok so the issue here is that the checkboxes do not function well in our conditional statements as such custom code is required to perform the conditional on the checkboxes.

Have a look at the link below as it should be able to help you write conditionals with the checkboxes.
https://toolset.com/forums/topic/how-to-use-conditional-output-with-checkboxes/#post-1469649

Please let me know if this helps.
Thanks,
Shane

#2162905

Hi,
I just copied the function and activated it – and I used the shortcode, but it does not work properly. Maybe in the given example some ' or " are missing or are not in the right place?

#2162945

Shane
Supporter

Les langues: Anglais (English )

Fuseau horaire: America/Jamaica (GMT-05:00)

Hi Martin,

Would it be possible to provide me with admin access to the website so that I can have a look to see whats happening?

I've enabled the private fields for you to send me the credentials.

Also please let me know the page where you are testing this out.

Thanks,
Shane

Le sujet ‘[Fermé] How to if a certain value in checkboxes field is set?’ est fermé à de nouvelles réponses.