PDA

View Full Version : append form entry to URL



allfolkedup
10-18-2006, 07:58 PM
Hey,

I need some help...:confused:

I want to create one text field and when a user enters a number in that field I want it to append that number onto the URL.

E.G

If the webpage is www.example.com and the user enters 111 into the text field, when they click submit I want it to send them to www.example.com/111

Any help would be greatly appreciated

Thanks

Twey
10-18-2006, 08:03 PM
<form action="noscript.html" onsubmit="this.action = '/' + this.elements.num.value;">
<input type="text" name="num">
<input type="submit">
</form>Ideally, you'd submit the form to a server-side script, which would then display the appropriate content.

allfolkedup
10-18-2006, 08:16 PM
thanks, works great