Hi,
I have a problem with a simple piece of Javascript
Markup:
-
<label for="route">How did you find our website?:</label>
-
<select name="nameroute" id="route" onChange="show()">
-
<option>Search engine - Google</option>
-
<option>Search engine - Yahoo</option>
-
<option>Search engine - MSN</option>
-
<option class="Link">Link from another website</option>
-
<option class="Mag">Magazine/newspaper/brochure</option>
-
<option class="Other">Other</option>
-
</select><br />
-
JS:
-
function show(){
-
var RouteInput;
-
RouteInput = document.getElementById("route")
-
-
if (RouteInput.value == 'Other'){
-
alert("Other works!")
-
} else if (RouteInput.value == 'Magazine/newspaper/brochure'){
-
alert("Mag works")
-
} else if (RouteInput.value == 'Link from another website'){
-
alert("Link works");
-
}
-
-
}
-
This works as i expected in FireFox 2, Safari 3 and Opera 9 (all win), but does not work in IE.
Can anyone tell me what I am doing wrong?
Thanks in advance!