Dieser Thread wurde gelöst. Hier ist eine Beschreibung des Problems und der Lösung.
Problem:
The issue here is that the user wanted to create dependent parent fields in Toolset Forms.
Solution:
Unfortunately it is not possible to create dependent fields in our Toolset Forms plugin. Parent selection fields are not programmed to be dependent on another parent field selection
This support ticket is created vor 4 Jahren, 11 Monaten. 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.
I have successfully setup relationships between the following post types:
Job Sectors -> Job Departments -> Job Titles
I can successfully use filters to find a contact here: versteckter Link
(click into the dropdowns Industry, Department, Job and choose the following: -FILM - DIRECTING - Director and click on Search)
the following Name will appear:
Tobias Fueter
So this works as expected.
Go to this link: versteckter Link
and click on the blue button 'add contact'
My question now is:
how can I create dropdowns with Field Dependencies in this contact form so I can choose the Job Sector, Job Department and then Job Title for a contact?
I know how I can just add a Job Title, but the problem with that is, that if you have the same Job Title (f.ex. CEO) in several Job Sectors and Job Departments than the user will not know what 'CEO' to choose in the Job Title Dropdown.
If there is no way to do Field Dependencies in a cred form, what workaround would you suggest?
Unfortunately there isn't a way to have the fields dependent on each other. This means that if the user selects Job Sector A, in the Job Department they will still get all the posts that are in the Job Department.
The best approach to this is just create the contact form as a child of the Job Title. This is because the Job title would already be in a relationship with Sector and Department. No need to relate the application to the Job Title, Department and Sector.
Thank you Shane for the quick reply. Yeah I did that and I understand that. But the problem with this is:
If you have this:
-FILM -> MANAGMENT -> CEO
- ADVERTISING & PR -> MANAGMENT -> CEO
The you will be able to pick two CEO in the relationship select dropdown, but the user will not know, if he picked the 'Film CEO' or the 'Advertising CEO' - so the contact might be related to the wrong job sector...
However, not if the user applies to the CEO job directly from the CEO job post page.
You do have the option to add the child post link to the Job Page and when they click the link "Apply for Job" it will take you to the form with the correct parent already filled out.
Also you can hide the field so that the user doesn't change the parent.
Thanks Shane, yeah I am aware of that link, but that means, that a user cannot:
- create a user and in the same cred form add a job sector, department and job title?
I am building a contact database and would like users to add a new contact and add job titles to the contact profile directly? How would you solve that? I don't think there would be a job page, no? it would have to be added to the contact single view page?
Here's the sample page (you will need credentials to see it) versteckter Link
Sorry, but I still don't really understand how I can achieve this- thanks for elaborating.
"that a user cannot: - create a user and in the same cred form add a job sector, department and job title?"
No this won't be possible to do since the relationships would be dependent on the parents created. You will need to create the job in sequential order.
"I am building a contact database and would like users to add a new contact and add job titles to the contact profile directly"
If the user is going to create a job, then they would need to select Department for that job and that department would already need to exist.
There are 2 ways you can do this. You can have a dedicated Create a Job page where the user can fill out the relevant information and select the correct department for the job and create the job title there.
Secondly you can send the user to a page where there is a list of all the departments and on that list you can add a child post creation button on each item in the list.
This way the user can click the button to create the job with the Department already filled in.
Just to clarify: I am NOT looking for a way to 'create new jobs'. The Job Titles, Departments and Sectors are all predefined in the backend and have relationships with each other.
What I am looking for is for a user to be able to create a new contact and then choose the job sector, then dependent on that choose the job department and then dependent on that selection choose from a list of available job titles-
This way, every contact in the database has a job title and can then be filtered in a view, by sector, department, job title.
Again, if I can give you my credentials in a private message I think you'll understand better for what I am going for.
I'm assuming that the Contact would be related to the Sector or the Job Title ?
What i'm saying is that if you want the user to always create the correct contact it would be best to link to the creation form directly from the parent that you would want them to select.
However it will only work with one relationship field. So if there are multiple relationship fields on the form then we don't have a way for them to depend on each other to present the related value.
Also there isn't a workaround for this dependency.
Okay, so basically in your own toolset example for real estates:
I can filter as a user for estates that are in
- country
- state
- city
But if I add an estate as a user with a form, I will not be able to distinguish between a city named birmingham, alabama, usa - and a city names birmingham in the UK?
I have looked at the toolset real estate example and that's what it looks like.
This kind of defeats the purpose of having a multilevel filter? If there is a multi-level filter, then there should also be an option of having a multi-level entry option?
Thx, still trying to find a solution, sorry 🙂
Tobi
Correct it wouldn't be possible to have the dependency fields in CRED.
"I would like the user to be able to select first a country, then a state and then the city in a form"
You are able to do this, however this won't be a dependency field, so if the user picks Canada, then the state field will show California and California is NOT in the USA.
The user will need to select the State that would apply to Canada.
Okay, that might be doable as a worst case scenario, but the bigger problem is then that on the third level ALL cities will show up, so the list becomes VERY long, you know what I mean? Do you have any solution for that? Thank you!
Would you be so kind and let me know what I would have to look for in the custom code as principle? What's the mechanism you would look for? This way I can look in the right direction...
Thanks so much, afterwards we can close the issue 🙂