<jo**********@gmail.com> wrote in message
news:11**********************@p10g2000cwp.googlegr oups.com...
I need a form with one field, they type in a number (say 1234) and then
it takes them to a website: xyz.com/index.php?=1234
This is what I have so far, it may be completely incorrect, though.
<form name="PartSearch" id="PartSearch">
<input type="text" id="part" name="part"/>
<script>
redir {
document.location =
'http://www.icsource.com/icsourcewdl/icswdl.aspx?user=rezar&part=' +
getElementByID('part').value
}
</script>
<input type='button' onClick='redir'>
</form>
Please Help.
Thanks,
Jordan
Try this:
<html>
<head>
<title>redir.htm</title>
<script type="text/javascript">
function redir() {
var val = document.PartSearch.part.value;
if (val == "") return;
var url =
"http://www.icsource.com/icsourcewdl/icswdl.aspx?user=rezar&part=";
document.location.href = url + val;
}
</script>
</head>
<body>
<form name="PartSearch">
<input type="text" name="part">
<input type="button" value="Lookup" onclick="redir()">
</form>
</body>
</html>