This is a simple script to select a State then depending on the State chosen select a Region, then click to go to that Web Site
It works perfectly in IE.
the code is on http://goldcoast.info/Chat.php
I have tried a lot of things to try get this to work in Firefox, symptom is when you click on the button it will not go to the selected web site.
How would I get this working in Firefox?
<script language='JavaScript'>
function setOptions(chosen) {
var selbox = document.myform.opttwo;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please Select State',' ');
}
if (chosen == "NSW") {
selbox.options[selbox.options.length] = new Option('Blue Mountains','bluemountains.info');
selbox.options[selbox.options.length] = new Option('Coffs Coast','coffscoast.info');
}
if (chosen == "QLD") {
selbox.options[selbox.options.length] = new Option('Cairns','cairns.info');
selbox.options[selbox.options.length] = new Option('The Gold Coast','goldcoast.info');
}
if (chosen == "VIC") {
selbox.options[selbox.options.length] = new Option('Geelong','geelong.info');
selbox.options[selbox.options.length] = new Option('Phillip Island','phillipisland.info');
}
}
</script>
<form name="myform"><div class="centre">
State<br>
<select name="optone" size="1"
onchange="setOptions(document.myform.optone.options[document.myform.optone.selectedIndex].value);">
<option value=" " selected="selected"> </option>
<option value="NSW">New South Wales</option>
<option value="QLD">Queensland</option>
<option value="VIC">Victoria</option>
</select><br>Region<br>
<select name="opttwo" size="1">
<option value=" " selected="selected">Please Select State</option>
</select><br />
<input class="red" type="button" name="go" value="Go There"
onclick="window.location.href('http://' + document.myform.opttwo.options[document.myform.opttwo.selectedIndex].value + '/index.php');return false">
</div></form>
Firebug shows warnings, so many warnings, about what Brendan wrote. It also says
pfcClient is not defined– try to fix that. And get rid of all these warnings from php script.