Page 1 of 1

need help with countries and regions arrays and select components

Posted: Wed Nov 04, 2015 3:53 am
by Fernando

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


need help with countries and regions arrays and select components

Posted: Wed Nov 04, 2015 3:43 pm
by Serhii Kulibaba

Hello Fernando,

Could you please clarify what exactly doesn't work?


need help with countries and regions arrays and select components

Posted: Fri Nov 06, 2015 8:17 am
by Fernando

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.


need help with countries and regions arrays and select components

Posted: Sun Nov 08, 2015 6:29 am
by Fernando

I think i have fixed it!