Solved

Change a get form to post action

Posted on 2003-10-24
11
255 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 32

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
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
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 32

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
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…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

707 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

21 Experts available now in Live!

Get 1:1 Help Now