Hi. Sorry if this has already been answered but I can't find it and the search function doesn't work with the word 'url'. I've been searching for quite a while now, and can't figure this out, though I believe the answe is fairly simple. What I need to do is this: Text form in an html page. Visitor writes something there and when he clicks the go/submit button, the page goes to a predefined url + the given variable. Something like: ... var myvar = anything; ... textbox input = anything when submit button clicked: some_function( 'http://www.site.com' + myvar ); something like: http://www.site.com/userdata Thank you and sorry for my bad english.
<form action="http://www.site.com/" onsubmit="location = this.action + this.myvar"><input type="text" name="myvar" /></form> HTML:
Kewl. Thanks a lot. This has solved one of my problems. Thank you, thank you, thank you, thank you. This wasn't really what I needed but it solved one of my probs. This solution gives the following result: mysite.com/?myvar=text-entered-by-user I edited the name and one it's done. But I still need to know if javascript can do this: mysite.com/text-entered-by-user - without any other specs. Anyway, thankx a lot, MMJ.
Oops! <form action="http://www.site.com/" onsubmit="location = this.action + this.myvar.value; return false"><input type="text" name="myvar" /></form> HTML: