Forum Moderators: open

Message Too Old, No Replies

Forms without?=

         

wcbzero

11:07 pm on Dec 29, 2006 (gmt 0)

10+ Year Member



Does anyone know how to make a form with a single input box and a submit button using the "get" method submit to a URL like http://example.com/get_data instead of like this: http://example.com/?=get_data or http://example.com/?some_data=get_data

eelixduppy

2:41 am on Dec 31, 2006 (gmt 0)



Hello,

I believe something like this would do the job, however, there may be a better solution :)


<form name="form">
<input type="text" name="field" />
<input type="button" onClick="document.location.href = ('http://www.example.com/' + escape(document.form.field.value))" value="Click me!" />
</form>

MatthewHSE

2:31 pm on Jan 3, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I haven't tried this, but if you don't want to use Javascript, you could probably POST the data to a serverside script that would parse the POST data and redirect to the URL in the format you choose.