Forum Moderators: open

Message Too Old, No Replies

Google CSE not holding search query in bottom form box

         

junior01

3:36 am on Mar 30, 2009 (gmt 0)

10+ Year Member



Mucking around with the CSE, the results page has 1 search box, then results, then another search box at the bottom (standard google results view).
Originally after searching from the index page or results page, after loading the results page the search query box would be empty (although the search results displayed fine), I then changed the search box "ie" component to value="UTF-8" (was originally "iso"...) and the first box now displays the search query in the textbox after doing a search, but not the second box.
How can I get the bottom search textbox to display the search query? Cookies/JS/simple html?

Relevant Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<!-- Google CSE Search Box Start -->

<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<div class="cse-branding-right" style="background-color:#000000;color:#FFFFFF">
<div class="cse-branding-form">
<form action="http://www.example.com/results.html" id="cse-search-box">

<div>

<input type="hidden" name="cx" value="partner-pub-2#*$!#*$!#*$!#*$!" />
<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="UTF-8" />
<input name="q" type="text" size="40" style="color:#ccc; background-color:#222; border:1px solid #444;" />
<input type="submit" name="sa" value="Search" style="border:1px solid #666666; background:#000000 url('fade.jpg') repeat-x; color:#979797;;"/>
</div>
</form>

</div>
<div class="cse-branding-logo">
<img src="http://www.google.com/images/poweredby_transparent/poweredby_000000.gif" alt="Google" />
</div>
<div class="cse-branding-text">
Custom Search
</div>
</div>

<p>
<!-- Google CSE Search Box Ends -->

<!search results code...not shown>

<!-- Google CSE Search Box 2 Start -->

<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>
<div class="cse-branding-right" style="background-color:#000000;color:#FFFFFF">
<div class="cse-branding-form">
<form action="http://www.example.com/results.html" id="cse-search-box2">
<div>
<input type="hidden" name="cx" value="partner-pub-2#*$!#*$!#*$!" />

<input type="hidden" name="cof" value="FORID:10" />
<input type="hidden" name="ie" value="UTF-8"/>
<input name="q" type="text" size="40" style="color:#ccc; background-color:#222; border:1px solid #444;" />
<input type="submit" name="sa" value="Search" style="border:1px solid #666666; background:#000000 url('fade.jpg') repeat-x; color:#979797;;"/>
</div>
</form>
</div>
<div class="cse-branding-logo">
<img src="http://www.google.com/images/poweredby_transparent/poweredby_000000.gif" alt="Google" />

</div>
<div class="cse-branding-text">
Custom Search
</div>
</div>

<p>
<!-- Google CSE Search Box Ends -->

junior01

11:30 am on Apr 1, 2009 (gmt 0)

10+ Year Member



So is this possible or not?
I havn't seen another self hosted Google CSE with the top and bottom search boxes having the search phrase written in both text boxes.
Would seem like a theoretically easy task to me.

1. when original search made, Store search phrase in cookie, 2. when page reloads q value=cookie.value