Jump to content

Archived

This topic is now archived and is closed to further replies.

gausie

Region selector not shown in IE

Recommended Posts

Hi everyone

Here is the script I've made - working in Firefox but not in IE. Any suggestions?

[code]<form onsubmit="return false;" name="region_form">
<select name="region_select" style="width: 90%;" onchange="regionListChange();">
<option>England</option>
<option>N. Ireland</option>
<option>Scotland</option>
<option>Wales</option>
<option>R. O. I.</option>
</select>
</form>

<div id="region_list"></div>[/code]

and here is the regionListChange command...

[code]function regionListChange(){

var england="<table class=\"region_list_table\"><tr><td colspan=\"2\" align=\"center\">All areas</td></tr><tr><td>Birmingham</td><td>Bournemouth</td></tr><tr><td>Bradford</td><td>Brighton</td></tr><tr><td>Bristol</td><td>Cambridge</td></tr><tr><td>Coventry</td><td>Derby</td></tr><tr><td>Exeter</td><td>Guildford</td></tr><tr><td>Hull</td><td>Ipswich</td></tr><tr><td>Kent</td><td>Leeds</td></tr><tr><td>Leicester</td><td>Liverpool</td></tr><tr><td>Luton</td><td>London</td></tr><tr><td>Manchester</td><td>Middlesbrough</td></tr><tr><td>Newcastle</td><td>Norwich</td></tr><tr><td>Nottingham</td><td>Oxford</td></tr><tr><td>Plymouth</td><td>Portsmouth</td></tr><tr><td>Reading</td><td>Sheffield</td></tr><tr><td>Southampton</td><td>Southend</td></tr><tr><td>Stoke</td><td>York</td></tr></table>";
var nireland="<table class=\"region_list_table\"><tr><td colspan=\"2\" align=\"center\">All areas</td></tr><tr><td>Belfast</td><td>&nbsp;</td></tr></table>";
var scotland="<table class=\"region_list_table\"><tr><td colspan=\"2\" align=\"center\">All areas</td></tr><tr><td>Aberdeen</td><td>Dundee</td></tr><tr><td>Edinburgh</td><td>Glasgow</td></tr><tr><td>Inverness</td><td></td></tr></table>";
var wales="<table class=\"region_list_table\"><tr><td colspan=\"2\" align=\"center\">All areas</td></tr><tr><td>Cardiff</td><td>Swansea</td></tr></table>";
var roi="<table class=\"region_list_table\"><tr><td colspan=\"2\" align=\"center\">All areas</td></tr><tr><td>Cork</td><td>Dublin</td></tr></table>";

switch(document.region_form.region_select.value){
case "England":
document.getElementById("region_list").innerHTML = england;
break;
case "N. Ireland":
document.getElementById("region_list").innerHTML = nireland;
break;
case "Scotland":
document.getElementById("region_list").innerHTML = scotland;
break;
case "Wales":
document.getElementById("region_list").innerHTML = wales;
break;
case "R. O. I.":
document.getElementById("region_list").innerHTML = roi;
break;
}

}[/code]

Thanks

Gausie

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.