View Full Version : help? can redirect..

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:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<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>
<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.

<input type="submit">

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.

10-13-2011, 07:50 AM

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

It works