Back problems
Hi everyone. I have a small problem with a javascript. The following script changes values in the secong select box depending on the value in the first. However, when I hit the "back" button on my browser, it will give values in the second box that don't match the first. Is there any way to reset all values in the pulldowns to a default everytime the page is loaded? Any other solutions?
Here's the script
var regionsArray = new Array(7);
regionsArray[0] = new Array("Botswana","Ethiopa","Kenya","Madagascar","Mali","Morocco","Namibia","South Africa","Tanzania","Uganda","Zambia","Zimbabwe");
regionsArray[1] = new Array("Argentina","Belize","Bolivia","Brazil","Chile","Costa Rica","Galapagos","Panama","Peru");
regionsArray[2] = new Array("Bhutan","Burma","Cambodia","China","India","Ladakh","Laos","Multi-Country","Nepal","Thailand","Tibet","Vietnam");
regionsArray[3] = new Array("Greece","Italy","Turkey");
regionsArray[4] = new Array("Egypt","Iran","Israel","Jordan","Lebanon","Syria");
regionsArray[5] = new Array("Australia","Hawaii","Indonesia","New Zealand","Samoa");
regionsArray[6] = new Array("Antarctic","Arctic")
function updateCountries(n) {
var arr = regionsArray[n];
var current = document.forms[0].countries.options.length;
for (var j=current;j>0;j--) document.forms[0].countries.options[j] = null;
for (var i=0;i<arr.length;i++) document.forms[0].countries.options[document.forms[0].countries.options.length] = new Option(arr,arr);
}