Code: Select all
function FillCountry(cboCountry, cboState, sDefaultCountry){
var sDefaultCountry, sDefault, sCountry
cboCountry.options.length=0
for(i=0;i<sCountryString.split("|").length;i++){
sCountry = sCountryString.split("|")[i];
if (sDefaultCountry == sCountry) {
sDefault=true;
if (navigator.appName=="Microsoft Internet Explorer"){cboState.focus();}
}
else {sDefault=false;}
if (sDefault) {cboCountry.options[i]=new Option(sCountry,sCountry,sDefault,sDefault);}
else {cboCountry.options[i]=new Option(sCountryString.split("|")[i]);}
}
}
if (navigator.appName=="Netscape"){
isNav=true
}
function FillState(cboCountry, cboState, sDefaultState){
var sDefaultState, sState, sDefault
cboState.options.length=0
for(i=0;i<sStateArray[cboCountry.selectedIndex].split("|").length;i++){
sState = sStateArray[cboCountry.selectedIndex].split("|")[i];
if(sDefaultState == sState) {
sDefault=true;
if (navigator.appName=="Microsoft Internet Explorer"){cboState.focus();}
}
else {sDefault=false;}
if(sDefault) {cboState.options[i]=new Option(sState,sState,sDefault,sDefault)}
else {cboState.options[i]=new Option(sState,sState);}
}
}
var sCountryString ="|Afghanistan|Albania|Algeria|American Samoa|Angola|Anguilla|Antartica|Antigua and Barbuda|Argentina|Armenia|Aruba|Ashmore and Cartier Island|Australia