...

View Full Version : help? can redirect..



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>

Old Pedant
10-13-2011, 07:43 AM
You forgot the http:// in front of "www.yahoo.com".

It should work to take you to google, as written, but not to yahoo.

jassi.singh
10-13-2011, 07:50 AM
Hi,

Please prefix http:// in front of any other domain url like as you did in http://www.google.com/.

It works



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum