Solved

Get Form and Post Combine

Posted on 2004-09-01
8
478 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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…
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 …
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…

823 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