?
Solved

Get Form and Post Combine

Posted on 2004-09-01
8
Medium Priority
?
484 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
[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
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
Independent Software Vendors: 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

7 Extremely Useful Linux Commands for Beginners

Just getting started with Linux? Here's a quick start guide that has 7 commands that we believe will come in handy.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day 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…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
Suggested Courses

771 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