Home › Toolset Professional Support › [Resolved] Conditional Fields to "Auto Hide" and only Show when condition are met
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 |
---|---|---|---|---|---|---|
- | 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)
Tagged: Setting up custom fields, Types plugin
Related documentation:
This topic contains 4 replies, has 2 voices.
Last updated by HermannS6808 5 years, 8 months ago.
Assisted by: Nigel.
Tell us what you are trying to do?
To get Conditional fields only to show when there "Condition is met. Thus "AutoHide"
Is there any documentation that you are following?
Looked through your KB
Is there a similar example that we can see?
See uploaded image.
What is the link to your site?
hidden link
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
Hi Herman
That's how conditional display is supposed to work.
There are two kinds of conditional display available in forms.
The first is set at the level of individual custom fields and operates whether editing a post in the back-end or with a front-end
form.
Edit the custom field group containing the relevant fields. If you want to make the visibility of field B dependent on the value of field A then you would edit field B and click the "Set condition(s)" button to add a condition, which brings up a dialog as shown in the screenshot.
The second is specific to forms (doesn't affect editing in the backend) and involves using conditional groups whereby you wrap any block of content (which can mean multiple form fields and HTML) inside a condition which depends on the value of some field. This is described here: https://toolset.com/documentation/user-guides/conditional-display-for-form-inputs/
If you have done this and find it doesn't work then it almost certainly points to a JavaScript error on the page, and you should check the browser console.
Hi Nigel,
Thanks for your super quick reply.
I tried with the "Conditional groups" but the moment the "Group" shows then the "Hidden" Fields also still renders their Containers as before even though they only show up as invisible spaces.
Anyway to Hide the spaces as well?
See attached picture.
Kind regards,
Hermann
Languages: English (English ) Spanish (Español )
Timezone: Europe/London (GMT+00:00)
I'm not sure I understand the problem.
On my local test site I have a form where several of the fields have been grouped inside a conditional display group whose visibility is dependent on the value of another field.
In the two screenshots you can see that when the condition is met the container div for the group has a display property of block, and when the condition is not met the container div has a display property of none.
So none of the child elements are visible or taking up any space either.
Hi,
I added more Conditional groups for every Condition, thus now it works.
Thx,
Hermann