Solved

Change a get form to post action

Posted on 2003-10-24
11
258 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 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

920 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now