Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Change a get form to post action

Posted on 2003-10-24
11
Medium Priority
?
286 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
  • 7
  • 2
  • 2
11 Comments
 
LVL 33

Accepted Solution

by:
shalomc earned 200 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

782 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