Skip Navigation

[Resolved] Creating a conditional drop down in a form based on post relationships created

This support ticket is created 3 years, 5 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 3 replies, has 2 voices.

Last updated by martink-8 3 years, 5 months ago.

Assisted by: Minesh.

Author
Posts
#2113751
Screenshot from 2021-07-14 01-49-37.png

Tell us what you are trying to do?
Tell us what you are trying to do?
Hi,
I am creating a business directory. I have 4 Custom posts type
1. Products
2.Product Sector
3. Product Sub-Sector
4. Product Categories

Note that a product can be classified in to 3 levels;
level 1 -Product Sector
Level 2-Product Sub-Sector
Level 3-Product Categories

The relationships include the following.
1.Product sector can has one to many relationship with Sub-Sector
2.Product Sub-Sector has a one to many relationship with Product Categories
3.Product Sector has a one to many relationship with Products
4.Product Sub-Sector has a one to many relationship with Products
5.Product Categories has a one to many relationship with Products

I have created a form representing the products Custom Post Type.Products contains the relationships created in form of input fields namely;
1. Product Sector input field
2. Product Sub-Sector input field
3. Product Categories input field

I want the Product Form to have a cascading input field or your may call it conditional drop down. In the product form when I select A sector e.g Manufacturing, Then the Input field for sub-sector should restrict me to only the sub-sectors related to Manufacturing Sector. The same should apply to product category when a specific Product Sub Sector is selected.

Is there any documentation that you are following?
Yes I am using Toolset's WordPress Directory and Classifieds Sites Course

Is there a similar example that we can see?
No

What is the link to your site?
hidden link

#2113935

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

The thing is that you can filter your parent select dropdown select using the author field:
=> https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field

author Optional. Use it with a parent selector field to specify that the list of parent posts should be limited to those authored by the mentioned user ID. The value $current can be used to define that the current user should only see their own parent posts in a dropdown.

There is no such feature available to display such dependent dropdown or nor I've any workaround to share. You are welcome to submit a feature request using the following form:
- https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

#2114583

Sorry for the late reply, but I already found a solution to my problem. The following link https://toolset.com/forums/topic/create-cascading-dropdown/ had the answers I needed. Thank you so much for your assistance.

#2114585

My issue is resolved now. Thank you!