Solved

Change a get form to post action

Posted on 2003-10-24
11
276 Views
Last Modified: 2010-04-09
Hi,

This question is repeated elsewhere in a larger question - but if anyone can help me with this i might be able to progress the larger question.

Can this get form be converted to a post action?


<form method="get">

<input type="hidden" name="q">
<input type="hidden" name="query">

<input type="text" name="search" size="20" maxlength="255" ><br />

<input type="submit"style= "width:150;text-align:center" value="Google Search" onclick="this.form.q.value = this.form.search.value; this.form.query.value = '';this.form.action = ' http://www.google.com/search ';"> <br />


<input type="submit"style="width:150;text-align:center" value="Lycos" onclick="this.form.query.value = this.form.search.value; this.form.q.value = '';this.form.action = ' http://search.lycos.com/default.asp?lpv=1&loc=searchhp&query ';"> <br />

</form>

Thanks.
0
Comment
Question by:macuser777
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 2
  • 2
11 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 50 total points
ID: 9617742
Sorry, Google search does not support POST.
It can't be done.

0
 
LVL 4

Author Comment

by:macuser777
ID: 9617753
Thanks - that clear's that up! :)

0
 
LVL 7

Expert Comment

by:Xxavier
ID: 9617765
The form metid property can be changed like so

<form method="get" name="f1">

<input type="hidden" name="q">
<input type="hidden" name="query">

<input type="text" name="search" size="20" maxlength="255" ><br />

<input type="submit"style= "width:150;text-align:center" value="Google Search" onclick="this.form.q.value = this.form.search.value; this.form.query.value = '';this.form.action = ' http://www.google.com/search ';"> <br />


<input type="submit"style="width:150;text-align:center" value="Lycos" onclick="this.form.query.value = this.form.search.value; this.form.q.value = '';this.form.action = ' http://search.lycos.com/default.asp?lpv=1&loc=searchhp&query ';"> <br />

</form>
<form > 
<input type="button" name="q" onclick="f1.method='post'">
</form >
0
WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

 
LVL 7

Expert Comment

by:Xxavier
ID: 9617775
but as stated of course google will not accept post.
0
 
LVL 4

Author Comment

by:macuser777
ID: 9617780
>Xxavier - i'm gonna try that right now - i just accepted the previous comment that it couldn't be done -

- Stick around - i'll sort the point s out

thanks
0
 
LVL 4

Author Comment

by:macuser777
ID: 9617794
Hey - you got me all excited for a minute there!

Still thanks for the info - which i will try out now....
0
 
LVL 4

Author Comment

by:macuser777
ID: 9617811
>Xxavier

Is it possible to use one text input box when one of the searches is a get form and the other is a post action.

That's really what i'm trying to do.

0
 
LVL 4

Author Comment

by:macuser777
ID: 9617852
http://oldlook.experts-exchange.com/Web/Web_Languages/HTML/Q_20777536.html

please check this out

(your points from this question are there as well Xxavier)
0
 
LVL 33

Expert Comment

by:shalomc
ID: 9617874
Hey,
Let's suppose that Google did support POST, and you want to POST to google and GET to Lycos.
Your form would look like this: (notice the Google button action)

<form method="get">

<input type="hidden" name="q">
<input type="hidden" name="query">

<input type="text" name="search" size="20" maxlength="255" ><br />

<input type="submit"style= "width:150;text-align:center" value="Google Search" onclick="this.form.q.value = this.form.search.value; this.form.query.value = '';this.form.action = ' http://www.google.com/search '; this.form.method= 'POST';"> <br />


<input type="submit"style="width:150;text-align:center" value="Lycos" onclick="this.form.query.value = this.form.search.value; this.form.q.value = '';this.form.action = ' http://search.lycos.com/default.asp?lpv=1&loc=searchhp&query ';"> <br />

</form>
0
 
LVL 4

Author Comment

by:macuser777
ID: 9617898
>shalomc

that's interseting - i noticed the button action

I'm going to try that in reverse, ie form method = post action, and then ; this.form.method ='get'; for my google search.

that would solve my problem posted above if i can make it work.

i'll try and put it together now

0
 
LVL 4

Author Comment

by:macuser777
ID: 9617908
Nope

this is what i tried - it doesn't send the google request to google. It just sends it to apple.


<FORM method=post action="http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/70906/wo/AO49YhxmiP193DkmmSA2MqIKqmc/0.0.7.1.0.5.11.1.0.1">

<input type="text" name="0.7.1.0.5.11.1.0.1.4" size="24" maxlength="255"><br />
         
<SELECT name="0.7.1.0.5.11.1.0.1.12">

<OPTION value="0">All </OPTION>
<OPTION value="1">Hardware</OPTION>
<OPTION value="2">Accessory</OPTION>
<OPTION value="3">Software</OPTION>
</SELECT>

<input type="submit"style= "width:77;text-align:center" value="Apple Store" > 


<input type="hidden" name="q">

<input type="submit"style= "width:150;text-align:center" value="Google Search" onclick="this.form.q.value = this.form.search.value;
this.form.query.value = '';this.form.action = ' http://www.google.com/search ';this.form.method ='get'; "> <br />


</form>
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question