Skip Navigation

[Gelöst] Creation a custom field condition based on checkboxes selection

This support ticket is created vor 3 Jahre, 7 Monate. 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 3 Antworten, has 2 Stimmen.

Last updated by Nigel vor 3 Jahre, 7 Monate.

Assisted by: Nigel.

Author
Artikel
#1759767

Hi,

I need to create custom fields (for a custom front-end form later on) where I can add Other as an option...

Let me explain: their current Google form that I need to reproduce has a list of checkboxes (where they can select only 3 values) and one of the options is "Other" with a text field to enter the value...

What I would like to do is create a bunch of checkboxes and have a textfield appear IF the checkbox "Other" is selected (and hide otherwise).

So, I created my checkboxes and my text field. When I try to set a condition on the text field, I see the other fields (in basic), but not the checkboxes... So, there seems to be a limit with checkboxes... I then tried the advanced conditions... With the help of the content previously there, here's my second-to-last attempt (previous ones included without the "wpcf-", with and without quotes...):
($(wpcf-primary-high-level-shared-goal) eq 'Other')

Based on that document (https://toolset.com/course-lesson/custom-fields-conditional-display/), I also tried this:
($(wpcf-primary-high-level-shared-goal) = 'Other')

None of them work (P.S. Other is the actual value, not just the label).

So, is there a code I can put there, or it's simply not possible with a list of checkboxes (I tried with drop-downs, radio buttons, etc and it was working fine)? Is there some custom code I can use?

Thank you.

#1760401

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+00:00)

Screenshot 2020-08-28 at 14.57.35.png

Hi Nelson

I checked, and it seems that checkboxes are simply not supported in the conditional display set on the Types custom fields themselves.

But, it is possible by using Conditional Display Groups in Forms, and from your question it appears that is what you objective is anyway.

See the screenshot where I have a checkboxes field "Checkers" that I use in the test for such a condition in a form, which I tested and can confirm it works.

https://toolset.com/course-lesson/conditional-display-for-form-inputs/

#1760417

Great! I'll try that when I'll create my form...

But, from what I understand, it also means that people that use the front-end form will be able to add "Other" content, but people (ex: administrators) won't be able to do so in the back-end (unless I let the "Other" text field always visible)?

Thank you,
Nelson

#1760419

Nigel
Supporter

Languages: Englisch (English ) Spanisch (Español )

Timezone: Europe/London (GMT+00:00)

Correct.

There is no way to hide the extra text field based upon the checkboxes field in the backend.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.