Skip Navigation

[Resolved] Relationship in CRED FORM

This support ticket is created 5 years 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 8 replies, has 2 voices.

Last updated by sergeP 5 years ago.

Assisted by: Minesh.

Author
Posts
#1381813

Hello,

I created The following relationships :
- Country => Region (one to many)
- Region => Cities (one to many)
- Artist => Country (one to one)
- Artist => Region (one to one)
- Artist => City (one to one)

I want to let the User create the one to one relationship connection between it's "Artist" CPT and Country / City / City.
I need the Form to only display the region connected to the country and only the cities connected to the region.
But for now, the form show all the available cities and regions, not only the ones connected to the selected country or region.

In CRED Form :

  
	<div class="row">
		<div class="form-group col-sm-12">
			<label>Chanteurs et groupes à suivre Pays</label>
			[cred_field field='@pays-groupe-chanteur-artiste-suivre.child' class='form-control' output='bootstrap' select_text='--- non défini ---']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-sm-12">
			<label>Chanteurs et groupes à suivre Départements</label>
			[cred_field field='@chanteur-et-groupes-a-suivre-departement.child' class='form-control' output='bootstrap' select_text='--- non défini ---']
		</div>
	</div>
	<div class="row">
		<div class="form-group col-sm-12">
			<label>Chanteurs et groupes à suivre Villes</label>
			[cred_field field='@chanteur-et-groupes-a-suivre-ville.child' class='form-control' output='bootstrap' select_text='--- non défini ---']
		</div>
	</div>

Could you help please ?
Thank you in advance,
Best

#1381955

Minesh
Supporter

Languages: English (English )

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

Hello. Thank you for contacting the Toolset support.

As I understand, you want to have a dependent filter for your select2 Country / Region / City that when the country field changed it should load the associated Region and when the user changed the Region it should load the associated city.

There is no such feature exists with Toolset forms. The only thing I can do is encourage you to file a new feature request using the following link:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

#1382169

Thank you for your answer,

I am surprise as it seems to be something pretty common, even on simple websites.
Is there a way to achieve this goal with conditionnal ?

Thank you in advance.
Best regards,

#1382177

Or is it possible not to have a list while clicking on the select 2 field but only a result list after a research ?
It is very strange to present regions from other countries when users click on the field (before typing the search).

Thank you in advance.
Best

#1382723

Minesh
Supporter

Languages: English (English )

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

I understand your concern and I've raised this again in front of concern people. But to add your voice I strongly suggest you should file a new feature request:
=> https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/

Unfortunately, I have no workaround to offer at the moment but filing a new feature request will help.

However, if you can send me the access details, I will check and try to find a solution if possible so that select2 search will not trigger until you will not type.

#1383971

Minesh
Supporter

Languages: English (English )

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

Can you please share the problem URL where I can see the form?

#1385789

Hello Minesh,

Sure.
hidden link

Thank you

#1386991

Minesh
Supporter

Languages: English (English )

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

I checked and try to troubleshoot this further but unfortunately, I do not find any way to add character limit. The only thing I can do is encourage you to file a feature request.

#1387945

My issue is resolved now. Thank you!