Solved

Get Form and Post Combine

Posted on 2004-09-01
8
477 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
 
LVL 21

Expert Comment

by:pinaldave
ID: 11958922
Hi macuser777,
great!
Regards,
---Pinal
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This article discusses four methods for overlaying images in a container on a web page
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
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 …

706 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

19 Experts available now in Live!

Get 1:1 Help Now