exodus1211
10-13-2011, 06:25 AM
what wrong, it just adds the website to the end of the address bar, and it doesnt redirect???help please:cool:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>
<h1>hello</h1>
<form onsubmit="return go();">
<select name="website" id="website">
<option value="http://www.google.com/">google.com</option>
<option value="www.yahoo.com">yahoo.com</option>
</select>
<script type="text/javascript">
function go() {
var s = getElementById("website");
window.location = s.options[s.selectedIndex].value;
return false; //prevents the form from being submitted to the server.
}
</script>
<input type="submit">
</form>
</div>
</body>
</html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>
<h1>hello</h1>
<form onsubmit="return go();">
<select name="website" id="website">
<option value="http://www.google.com/">google.com</option>
<option value="www.yahoo.com">yahoo.com</option>
</select>
<script type="text/javascript">
function go() {
var s = getElementById("website");
window.location = s.options[s.selectedIndex].value;
return false; //prevents the form from being submitted to the server.
}
</script>
<input type="submit">
</form>
</div>
</body>
</html>