Form Get Problem (Full Version)

All Forums >> [Web Development] >> ASP, PHP, and Database



Message


Joey -> Form Get Problem (4/17/2009 15:12:31)

When i use get to post a form to another page i get the button showing up. How do i stop the button field from showing up?

Here is my code:
<form method="get" action="http://www.test web site.com">
	<input name="Text1" type="text" /><br />
	<input name="button" type="submit" value="Submit" /></form>


and here is the output:
http://www.test web site.com/?Text1=123&button=Submit




TexasWebDevelopers -> RE: Form Get Problem (4/17/2009 16:55:34)

There are fundamental differences between using "GET" and "POST" in a form.
But in the simplest language GET means that the form data is encoded by a browser into a URL and should be use only to retrieve data. POST means the form data is to appear within a message body and is used for updating data, etc.
Getting data=GET
Passing data=POST
So what are you really trying to do here?




jeepless -> RE: Form Get Problem (4/17/2009 17:08:47)

In the line <input name="button" type="submit" value="Submit" />, try removing the name="button" part of it. So you would end up with:

<input type="submit" value="Submit" />





Joey -> RE: Form Get Problem (4/17/2009 17:39:48)

Thanks jeepless that makes the string perfect!




BeTheBall -> RE: Form Get Problem (4/17/2009 23:00:06)


quote:

ORIGINAL: jeepless

In the line <input name="button" type="submit" value="Submit" />, try removing the name="button" part of it. So you would end up with:

<input type="submit" value="Submit" />




Hmmm. Learned something new today. That makes sense. Since a querystring is composed of name/value pairs, the taking away of the name prevents the pair from going into the querystring. Nice solution.




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
6.201172E-02