Hi Nigel,
Here is some parts of the code.
The "Pays" (country) taxonomy is always shown. Then, the "Province" part will switch from taxonomy A to B, depending the choice of the first one. Then, the third level (regions), will switch taxonomies #1 to #13, depending the choice of the second level taxonomy, and so on for the 4th level.
The thing is if I start with a specific 3rd and 4th level entry, and then I change the 3rd level entry, another 4th level taxonomy will show up. If I then select another 4th entry and submit the form, I end up with a post that may have #2 3rd level entry, #2 4rd level entry AND #1 4rd level entry enable in the good taxonomy, or create (same name) in the #2 4th level taxonomy.
I've ended up with a mess, having the same city created in many 4th level taxonomies, or a post with 2 4th level entries...
So I'm looking for a way to have ALL other taxonomies emptied, except the ones selected at the time of submission
That's a lot of code, but I don't know how to simplify. Also, my theme works with shortcode
<div class="cred-label">[wpml-string context="cred-lieu"]Ville et province[/wpml-string]</div>
[cred_field field='pays' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="pays_add_new" taxonomy="pays" type="add_new"]
[cred_show_group if="($(pays) eq '4005' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Province[/wpml-string]</div>
[cred_field field='ca-provinces' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[/cred_show_group]
[cred_show_group if="($(pays) eq '4004' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='fr-villes' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="fr-villes_add_new" taxonomy="fr-villes" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(pays) eq '4005' )" mode='fade-slide']
[cred_show_group if="($(ca-provinces) eq '3578' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Région administrative[/wpml-string]</div>
[cred_field field='region-qc' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3579' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-ab' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-ab_add_new" taxonomy="region-ab" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3585' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-cb' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-cb_add_new" taxonomy="region-cb" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3584' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-ipe' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-ipe_add_new" taxonomy="region-ipe" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3581' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-mb' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-mb_add_new" taxonomy="region-mb" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3582' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-nb' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-nb_add_new" taxonomy="region-nb" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3583' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-ne' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-ne_add_new" taxonomy="region-ne" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3577' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-on' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-on_add_new" taxonomy="region-on" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3580' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-sk' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-sk_add_new" taxonomy="region-sk" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3586' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville[/wpml-string]</div>
[cred_field field='region-tnl' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="region-tnl_add_new" taxonomy="region-tnl" type="add_new"]
[/cred_show_group]
[/cred_show_group]
[cred_show_group if="($(ca-provinces) eq '3578' )" mode='fade-slide']
[cred_show_group if="($(region-qc) eq '1481' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville et quartier[/wpml-string]</div>
[cred_field field='quartiers-abitibi' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="quartiers-abitibi_add_new" taxonomy="quartiers-abitibi" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(region-qc) eq '1580' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville et quartier[/wpml-string]</div>
[cred_field field='quartiers-bas-saint-laurent' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="quartiers-bas-saint-laurent_add_new" taxonomy="quartiers-bas-saint-laurent" type="add_new"]
[/cred_show_group]
[cred_show_group if="($(region-qc) eq '1498' )" mode='fade-slide']
<div class="cred-description">[wpml-string context="cred-logement"]Ville et quartier[/wpml-string]</div>
[cred_field field='quartiers-capitale-nationale' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
[cred_field field="quartiers-capitale-nationale_add_new" taxonomy="quartiers-capitale-nationale" type="add_new"]
[/cred_show_group]
(and so on for a total of 13 taxonomy in QC province, in Canada country)
[/cred_show_group]