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