Code:
<html>
<head>
<title>Customer Query Form</title>
<script type="text/javascript">
var redir = [
'new_customer.php',
'existing_customer.php',
'existing_customer_search.php'
];
function qIt() {
var q = document.getElementsByName('q');
for(var i = 0; i < q.length; i++){
if(q[i].checked !== true){continue;}
else{alert(redir[q[i].value]);}
/*
you can replace alert with location.href = redir[q[i].value];
*/
}
}
</script>
<style>
body { font-size: 12pt; font-family: Verdana, Arial, Helvetica, sans-serif; }
p.indent { padding-left: 15px; }
</style>
</head>
<body>
<h2>Please Select an Option</h2>
<form id="myform" name="myform" onsubmit="return false" action="">
<p class="indent">
<input type="radio" name="q" value="0"><label>New Customer</label>
<br />
<input type="radio" name="q" value="1"><label>Existing Customer</label>
<br />
<input type="radio" name="q" value="2"><label>Customer Search</label>
<br /><br />
<input type="button" value="Submit" onclick="qIt();" />
</p>
</form>
</body>
</html>
Bookmarks