Skip Navigation

[Resolved] Field Dependency in CRED form

This thread is resolved. Here is a description of the problem and solution.

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 4 years, 9 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
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 18 replies, has 2 voices.

Last updated by tobiasF-3 4 years, 9 months ago.

Assisted by: Shane.

Author
Posts
#1470917

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:
hidden 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:
hidden 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?

Thanks a lot
Tobias

#1471467

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

Thank you for getting in touch.

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.

Thanks,
Shane

#1471479

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...

Do you know what I mean?

Thx
Tobi

#1471491

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

I see what you mean.

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.

Have a look at the link below.
https://toolset.com/documentation/post-relationships/selecting-parent-posts-using-forms-create-child-items/#creating-forms-when-a-parent-post-is-preselected

This should provide you with a more detailed explanation of a solution.

Thanks,
Shane

#1471515

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)
hidden link

Sorry, but I still don't really understand how I can achieve this- thanks for elaborating.

#1471683

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

"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.

Please let me know if this helps.
Thanks,
Shane

#1471793

Yeah I think we are talking about option 2.

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.

Thx a lot for your patience.
Tobi

#1471807

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

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.

Thanks,
Shane

#1471809

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

#1473247

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2020-01-22 at 9.22.39 AM.png

Hi Tobias,

This occurs because the view filters have dependencies, this means that views has the ability to only filter based on the previously selected values.

It is actually a setting in views that allows this. See My screenshot

In Forms there isn't a functionality like this.

Thanks,
Shane

#1475461

Okay thanks Shane, but that means that what I want is NOT possible?

How would you solve the problem I have listed above?

Again to clearly ask my question (sorry):
I would like the user to be able to select first a country, then a state and then the city in a form

thx
T

#1476897

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

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.

Thanks,
Shane

#1476943

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!

#1476949

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Tobias,

I understand what you mean but we currently don't have a solution for this.

It would be possible with some amount of custom code but this would be out of the scope of our support forum.

Thanks,
Shane

#1476957

Okay, I understand.

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 🙂