Skip Navigation

[Resolved] get the selected value from a control in order to hide/sh

The Toolset Community Forum is closed, for technical support questions, please head on to our Toolset Professional Support (for paid clients), with any pre-sale or admin question please contact us here.
This support ticket is created 7 years ago. There's a good chance that you are reading advice that it now obsolete.
This is the community support forum for Types plugin, which is part of Toolset. Toolset is a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients and people who registered for Types community support can post in it.

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 julienB-4 7 years ago.

Assisted by: Christian Cox.

Author
Posts
#504851

Hi !

In a Custom Search, I'm setting the filters.
I have 3 controls selector:

Control1 is a list of countries (ex: France and Belgique)
Control2 is a list of "departments"
Control3 is a list of "provinces"

I would like to hide or show the control2 and the control3 depending on the selected value of control1...but I can't figure how to get this value to use it in a conditional output statement !

Can somebody guide me please ?

Thank you in advance.

#505052

Hi! I'll be glad to point you in the right direction. We currently provide the ability to limit filter inputs according to available results. We have an article about that here:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/

We also have a real estate reference site available for you to use as an example. You can find that reference site here:
https://toolset.com/reference-site/toolset-real-estate/

In this reference site, you can see how the city and state search fields are set up, and how the filter inputs update according to the available results of your search. While it's not a completely customizable solution, it may work for what you would like to accomplish. Let me know if I can help explain any specific part of the process, and I will be glad to provide assistance.

#505103

Hi Christian !

Thank you for your help and for the links !
Actually it is not exactly what I'm trying to do, sorry.

With the real estate reference site, the example show a "state" control and a "city" control.
In my case, I have "country", "departement", "province" and "city" control.
Departement list is for France only while Province list is for Belgique only.

When I select the Value "France" in the "country" control, I would like to completely hide the control "Province" and the opposite when I select "Belgique".

Do you think there is a way to do that ?

Otherwise I'm looking to find a way to merge my custom fields "Departement" and "Province" in only one control.
Is that possible too ?

Thank you very much for your help, if I'm trying to do something the wrong way with the custom filter I will find a new strategy to display my data and my custom fields.

#505364

Hi, completely hiding a control isn't currently an option when changing input values, and would require some custom code - possibly JavaScript and/or PHP.

Merging two custom fields in a single control is possible but requires that you merge the two custom fields in the backend of your site as well. For instance, you have one custom field for Province / Departement, and include all your options in this single custom field.

#506801

Hi Christian !

Sorry for the delay with my answer !

Thank you for your help !

I'm digging a bit more with a php solution otherwise I will change my strategy !

Good continuation !

Julien

The forum ‘Types Community Support’ is closed to new topics and replies.

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