Fernando
Posts: 0
Joined: Sat Mar 14, 2015 10:59 am

need help with countries and regions arrays and select components

Hi,

I need help to make this work: i need to show an array list with countries in a select component and then show an array list with regions in other select component when the country is selected.

I would like to use this content http://sourceforge.net/projects/count... that has arrays like

var country_arr = new Array("Afghanistan", "Albania", "Algeria", ... );
var s_a = new Array();
s_a[0]="";
s_a[1]="Badakhshan|Badghis|Baghlan|....";
...

and has this code inside
function print_country(country_id){
// given the id of the tag as function argument, it inserts tags
var option_str = document.getElementById(country_id);
option_str.length=0;
option_str.options[0] = new Option('Select Country','');
option_str.selectedIndex = 0;
for (var i=0; i

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

need help with countries and regions arrays and select components

Hello Fernando,

Could you please clarify what exactly doesn't work?

Fernando
Posts: 0
Joined: Sat Mar 14, 2015 10:59 am

need help with countries and regions arrays and select components

Hi Sergiy,

I need to use arrays with countries and regions and put this information in a select component with countries and then put the regions of this country in other select component (it changes depending the country selected in the first one).

Thank you.

Fernando
Posts: 0
Joined: Sat Mar 14, 2015 10:59 am

need help with countries and regions arrays and select components

I think i have fixed it!

Return to “Issues”