?
Solved

Get Form and Post Combine

Posted on 2004-09-01
8
Medium Priority
?
487 Views
Last Modified: 2006-11-17
Hi,

About a year ago I got this solution[code 1] from georgemarian to combine a get form and post action into one input box

I'm trying to alter it to work with another post action [code 2] but can't get it going

=========================code 1
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Search</title>
<style type="text/css">
<!--
input.text { width:150; text-align:left; }
input { width:150; text-align:center; }
//-->
</style>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function copydata() {

    myapple = "0.7.1.0.5.11.1.0.1.4"
    document.google.q.value      = document.myinput.search.value;
    document.teoma.q.value       = document.myinput.search.value;
    document.lycos.query.value   = document.myinput.search.value;
    document.apple.myapple.value = document.myinput.search.value;
   
    }
//-->
</SCRIPT>
<form name="myinput">
<input class="text" type="text" name="search" size="20" maxlength="255">
</form>
<form method="get" name="google" onSubmit="return copydata()">
<input type="submit" value="Google Search" onclick="this.form.action='http://www.google.com/search'">
<input type="hidden" name="q">
</form>
<form method="get" name="teoma" onSubmit="return copydata()">
<input type="submit" value="Teoma Search" onclick="this.form.action='http://www.teoma.com/search.asp';">
<input type="hidden" name="q">
</form>
<form method="get" name="lycos" onSubmit="return copydata()">
<input type="submit" value="Lycos" onclick="this.form.action='http://search.lycos.com/default.asp';">
<input type="hidden" name="query">
</form>
<form method="post" name="apple" onSubmit="return copydata()">
<input type="submit" value="Apple Store" onclick="this.form.action='http://store.apple.com/1-800-MY-APPLE/WebObjects/AppleStore.woa/71106/wo/tx4tB2eQANCD3J5wviQKzOyvFds/2.0.7.1.0.5.11.1.0.1';"><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="hidden" name="myapple">
</form>
</body>
</html>

0
Comment
Question by:macuser777
8 Comments
 
LVL 4

Author Comment

by:macuser777
ID: 11958729
===================code 2

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Search</title>
<style type="text/css">
<!--
input.text { width:150; text-align:left; }
input { width:150; text-align:center; }
//-->
</style>
</head>
<body>
<SCRIPT LANGUAGE="JavaScript">
<!--
function copydata() {


    document.pure.keywords.value      = document.myinput.search.value;
    document.ppc.keywords.value       = document.myinput.search.value;
      
    document.odp.search.value = document.myinput.search.value;
   
    }
//-->
</SCRIPT>
<form name="myinput">
<input class="text" type="text" name="search" size="20" maxlength="255">
</form>
<form method="get" name="pure" onSubmit="return copydata()">
<input type="submit" value="Web Search" onclick="this.form.action='http://www.myesearch.com/cgi-bin/search/smartsearch.cgi'">
<input type="hidden" name="keywords">
</form>
<form method="get" name="ppc" onSubmit="return copydata()">
<input type="submit" value="ppc" onclick="this.form.action='http://www.mysearch.com/cgi-bin/ppc/search/smartsearch.cgi'">
<input type="hidden" name="keywords">
</form>

<form method="post" name="odp" onSubmit="return copydata()">
<input type="submit" value="odp" onclick="this.form.action='http://    i   ~~~~~~   cra     cker.com/odp/odp.php';"><br />

<input type="hidden" name="odp">
</form>
</body>
</html>
0
 
LVL 4

Author Comment

by:macuser777
ID: 11958861
I have found another way....

will post in minutes...
0
 
LVL 4

Author Comment

by:macuser777
ID: 11958874
this works...somehow

<form method="get">


  <table width="98%" border="0" align="center">
    <tr>
      <td> <div align="right">
          <input type="hidden" name="keywords">
     
             
          <input type="text" name="search" size="20" maxlength="255">
        </div></td>
      <td><div align="left">
          <input type="submit" style="width:110;text-align:center" value="Web Search" onMouseover="showit(0)" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.search.com/cgi-bin/search/smartsearch.cgi?keywords ';">

          <input type="submit" style="width:110;text-align:center" value="DMOZ Directory" onMouseover="showit(1)" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.searcher.com/odp.php ';">


          <input type="submit" style="width:110;text-align:center" value="PPC Listings" onMouseover="showit(2)" onclick="this.form.keywords.value = this.form.search.value; this.form.action = ' http://www.search.com/cgi-bin/ppc/search/smartsearch.cgi?keywords ';">
        </div></td>
    </tr>
  </table>

</form>
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 21

Expert Comment

by:pinaldave
ID: 11958922
Hi macuser777,
great!
Regards,
---Pinal
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11959802
I'm glad you got it working - I'd forgotten that I'd even written that :-)

Sean
0
 
LVL 31

Expert Comment

by:seanpowell
ID: 11959868
Let me know also if you want a delete on this Q for you...
Thanks,
Sean
0
 
LVL 4

Author Comment

by:macuser777
ID: 11961590
Hi,

I put a request in at community support for a refund/PAQ - thoght it might be good to leave a solution in the databse.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 11963680
The question has been PAQ'd and the 225 points have been refunded.
RomMod
Community Support Moderator
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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.
The first step to building an amazing About page is to figure out what you want the page to say about your company. You then must grab the attention of the reader, boast a bit, tell a story and let others brag about you. With a little bit of thought…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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…
Suggested Courses

840 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