Solved

Get Form and Post Combine

Posted on 2004-09-01
8
480 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
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Do alert on select 6 29
Set time on Session (ASP) 14 31
Html split(text) Part2 6 25
Need help with FaceBook login 2 21
Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
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…

730 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