-
goto page textbox form
Hi All!!
A bit of a noob here but I was wondering if the following was possible.
I have a simple webpage that is going to say
"to find your page enter your ref no below"
Then I was hoping for a textbox and a go button........and when they click on the button it takes them to a matching page.
Eg, James has the reference AF54 so when he types it in, clicks go he will be redirected to
http://www.mysite.com/AF54.htm
Nothing personal or security required just a wee info page for them.
I hope someone can help :)
-
That idea has at least one major flaw. The user may input anything, and there is no guarantee that the page it represents exists. That said:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<form action="#" onsubmit="location = this.elements.choice.value + '.htm'; return false;">
<input type="text" name="choice"> <input type="submit" value="Go">
</form>
</body>
</html>
That'll do it.
-
Thank you very much!!!
That did the trick :D