Jump to content


Photo

Region selector not shown in IE


  • Please log in to reply
No replies to this topic

#1 gausie

gausie
  • Members
  • PipPipPip
  • Advanced Member
  • 40 posts
  • LocationA Syntax Error

Posted 11 August 2006 - 04:32 PM

Hi everyone

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

<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>

and here is the regionListChange command...

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;
	}

}

Thanks

Gausie
Inner Dreams My pen is there always - as inner dreams

Just remember: united, we are an idiot




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users