*

vansebas

  • ***
  • 35 posts
Simple dropdown boxes for country, region and city selection
« on: February 27, 2021, 02:23:32 PM »
I'm working with the theme Gamma, and that has a interactive country, region and city selection when posting a new listing.
I want it a little easier for my users and with three different dropdown boxes just like in the theme Zara.

I already have the three different dropdown boxes and loading the content from my locations which I filled in the admin panel. The only problem I still have is when I select the country "Netherlands" and I fill in a region and I change the country back to "Belgium" the dropdown boxes of Region and City won't get flushed and loaded with the new items that falls under the country "Belgium".

This is my code so far:
Code: [Select]
<div class="row">
<div class="row phone">
<label for="address"><?php _e('Country''gamma'); ?></label>
<div class="input-box"><?php ItemForm::country_select(osc_get_countries(), osc_user()); ?></div>
</div>

<div class="row phone">
<label for="region"><?php _e('Region''gamma'); ?></label>
<div class="input-box"><?php ItemForm::region_select(osc_get_regions(osc_user_country()), osc_user()) ; ?></div>
</div>

<div class="row address">
<label for="address"><?php _e('City''gamma'); ?></label>
<div class="input-box"><?php ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user()) ; ?></div>
</div>
</div>


What am I missing why the dropdown fields won't reset after changing a selected item?