...

View Full Version : simple html form question



sdptwd
05-29-2005, 09:52 PM
hello,
i am a complete newcomer to html with a simple question. could someone tell me how to do this - based on the following code....

<p>&nbsp;</p>
<form name="form1" method="post" action=http://www.mysite.com/*****/wfb.php>
<input type="text" name="textfield">
</form>
<p>&nbsp;</p>

how do i have the outcome of this text input form be inserted into the gap where the asterisks are? basically what i am trying to do is when you type in the text box and hit enter, you should be redirected to a URL with what you just typed included in its makeup.

many thanks for any help!
sdptwd

Coastal Web
05-29-2005, 11:14 PM
Many ways you could accomplish this (all of which you'd need to jump from HTML to another language...)

lets go with a simple javascript example that would work when hosted nearly anywhere. here's how it'd look:
(this has been tested, and works)
-------------------------------------------------

<html>
<head>
<script language="JavaScript">
<!---

function getMyPage(){
myArea = document.myForm.textfield.value;
location.replace("http://www.mysite.com/"+myArea+"/wfb.php");
}

//--->
</script>
</head>

<body>
<form name="myForm" action="javascript:getMyPage();">
<input type="text" name="textfield" size="15">
<input type="submit" value="Go!" name="submit">
</form>

</body>
</html>


Post back any questions or problems you have.
Samantha Gram

sdptwd
05-29-2005, 11:29 PM
hello samantha

thanks a million for the quick reply and solution. im pleased to say it works like a charm and the system is up and running now!

thanks again
sdptwd

Coastal Web
05-29-2005, 11:57 PM
dont mention it :)

Samantha Gram



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum