Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#field1 {
width:20em;
font:95% arial, sans-serif;
}
#field1 p {
margin-bottom:0;
}
</style>
<script type="text/javascript">
/* URL Picker ©2007 John Davenport Scheuer
* This notice must remain for legal use */
document.write('<style type="text/css">.noscript {display:none;}<\/style>');
function grabUrl(f, r){
if(!document.getElementsByName){
alert('Your Browser is too old for this form!')
return;
}
for (var e=document.getElementsByName('urlpick'), i = e.length-1; i > -1; --i)
if((typeof r=='number'&& i==Math.floor(r*e.length))||(typeof r!='number'&&e[i].checked))
f.reset(),e[i].checked=true,window.location=e[i].value;
}
</script>
</head>
<body>
<div class="noscript">
Javascript Required for the following form:
</div>
<form action="#" onsubmit="grabUrl(this);return false;">
<fieldset id="field1">
<legend>Pick Destination or hit "Go Random"</legend>
<input type="radio" name="urlpick" value="http://www.google.com/">Google<br>
<input type="radio" name="urlpick" value="http://www.yahoo.com/">Yahoo<br>
<input type="radio" name="urlpick" value="http://www.dynamicdrive.com/">Dynamic Drive<br>
<p><input type="submit" value="Go"> <input type="button" value="Go Random" onclick="grabUrl(this.form, Math.random());"></p>
</fieldset></form>
</body>
</html>
Bookmarks