multiple submit buttons

krofunk

New Member
Messages
216
Reaction score
5
Points
0
I started a project to make my own flavor of Google (like l33t google etc) its based on Google's own CSE.

now on googles home page they have a search and an I'm feeling lucky button. I have made both buttons but cannot get them to work within the same form, I have however managed to get the buttons to send the form data to different pages. :confused: This is kind of hard to explain lol

This is the code for my search form
Code:
<form name="f" action="results.html" id="cse-search-box" method="get">
  <div>
   <input type="hidden" name="cx" value="016374776113055568361:5xifn0wp6se" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" id="q" autocomplete="off" size="51" class="txbx" />
    <br /><span style="font-size:2px;">_</span><br />
    <input type="submit" name="sa" value="Search" class="btn" onClick="document.f.action='results.html';" />
   <input name=btnI type=submit value="I'm Feeling Lucky" class="btn" onClick="document.f.action='http://www.google.com/search';" />
  </div>
</form>
as you can see the I'm feeling lucky button is
Code:
<input name=btnI type=submit value="I'm Feeling Lucky" class="btn"  onClick="document.f.action='http://www.google.com/search';" />

the problem is that I need the cx=016374776113055568361:5xifn0wp6se...etc on the search button but I need it to not be there on the lucky button. :rolleyes: Does that make sense?

basically I need the lucky button to ignore these inputs and values
Code:
<input type="hidden" name="cx" value="016374776113055568361:5xifn0wp6se" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
Is this possible?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
<form name="f" action="results.html" id="cse-search-box" method="get">
   <input type="hidden" name="cx" value="016374776113055568361:5xifn0wp6se" />
    <input type="hidden" name="cof" value="FORID:9" />
    <input type="hidden" name="ie" value="UTF-8" />
    <input type="text" name="q" id="q" autocomplete="off" size="51" class="txbx" />
    
    <input type="submit" name="sa" value="Search" class="btn"  />
</form>
<form name="g" action="GOOGLE.html"  method="get" >
   <input type="hidden" name="q" value="">
   <input name="btnI" type=submit value="I'm Feeling Lucky" class="btn" onClick="document.g.q.value=document.f.q.value;" />
</form>
 
Top