Loblogomy

A blog by Aaron Logan
  • Home
  • Photos
  • Art
  • Twitter
  • Tumblr
  • CV
  • Contact

Unified Search Form

April 28, 2004 06:29 pm

UPDATE (12/04/05) —
Version 2.0 — I have changed the way the Unified Search Form works. The first block of code here is the new version (identical to the one on the left side of my page). I have left the code for the old version at the bottom of this post. Please feel free to adapt either the new or old version of the Unified Search Form to your uses. NB: please copy the image for the search buttons to your own site. Here it is: …or you can find your own image to use.


<font size="+1">Search</font> <font size="-3">(<a href="http://www.aaronlogan.com/blog/archives/2004/04/28/141">Get this form</a>)</font><br />
<form action="http://www.yoursite.com/blog/index.php" method="get" />
<input type="text" size="15" name="s" value="type query" onFocus="value=''" /><br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.yoursite.com/blog/index.php'; method='get'; s.name='s';" />this blog<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.lightmatter.net/gallery/search.php'; method='get'; s.name='searchstring'; photos.x='1'; photos.y='1';" />my photos<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.bugmenot.com/view.php'; method='get'; s.name='url';" />bugmenot<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://dictionary.reference.com/search'; method='get'; s.name='q'; " />dictionary<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://del.icio.us/search/'; method='get'; s.name='all'; " />del.icio.us<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://search.ebay.com/search/search.dll'; method='get'; s.name='satitle';" />eBay<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.froogle.com/froogle'; method='get'; s.name='q';" />froogle<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.google.com/search'; method='get'; s.name='q';" />google<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://maps.google.com/maps'; method='get'; s.name='q';" />google maps<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://scholar.google.com/scholar'; method='get'; s.name='q';" />google scholar<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www2.merriam-webster.com/cgi-bin/mwmednlm'; method='get'; s.name='va';" />med dictionary<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.ncbi.nlm.nih.gov/entrez/query.fcgi?CMD=search&DB=pubmed'; method='post'; s.name='term';" />pubmed<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.rottentomatoes.com/search/full_search.php'; method='get'; s.name='search';" />rotten tomatoes<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://www.whois.sc/domain-suggestions/'; method='get'; s.name='q';" />whois<br />
<input type="image" src="http://www.yoursite.com/images/misc/submit.gif" vspace="2" hspace="4" align="center" onClick="action='http://en.wikipedia.org/w/index.php'; method='get'; s.name='search';" />wikipedia<br />
</form>

***** ***** *****

BELOW IS THE OLD VERSION OF THE UNIFIED SEARCH FORM WHICH EMPLOYED RADIO BUTTONS AND LOOKED LIKE THIS:


Search (Get this form)

 

this blog

my photos

google

dictionary

wikipedia

whois

This is set up to default to searching your site. If your site uses a name other than “s” for the search variable, you’ll want to change that at each appropriate location (everywhere it is underlined here).


<script type="text/javascript" language="javascript">
function runquery() {
if (document.searchform.rb[0].checked == true) {
document.searchform.action='http://www.mysite.com/blog/index.php';
document.searchform.method='get';
document.searchform.s.name='s';
}
if (document.searchform.rb[1].checked == true) {
document.searchform.action='http://www.mysite.com/gallery/search.php';
document.searchform.method='get';
document.searchform.s.name='searchstring';
}
if (document.searchform.rb[2].checked == true) {
document.searchform.action='http://www.google.com/search';
document.searchform.method='get';
document.searchform.s.name='q';
}
if (document.searchform.rb[3].checked == true) {
document.searchform.action='http://dictionary.reference.com/search';
document.searchform.method='get';
document.searchform.s.name='q';
}
if (document.searchform.rb[4].checked == true) {
document.searchform.action='http://en.wikipedia.org/w/wiki.phtml';
document.searchform.method='post';
document.searchform.s.name='search';
}
if (document.searchform.rb[5].checked == true) {
document.searchform.action='http://www.whois.sc/domain-suggestions/';
document.searchform.method='get';
document.searchform.s.name='q';
}
return true;
}
</script>
Search <font size="-3">(<a href="http://www.aaronlogan.com/blog/archives/2004/04/28/141">Get this form</a>)</font><br />
<form name="searchform" action="http://www.mysite.com/blog/index.php" method="get" onSubmit="return runquery();" />
<input type="text" size="11" name="s" value="" />&nbsp;<input type="submit" onClick="return runquery();" value="Go" /><br />
<input name="rb" type="radio" value="0" checked="checked"/>this blog<br />
<input name="rb" type="radio" value="1" />my photos<br />
<input name="rb" type="radio" value="2" />google<br />
<input name="rb" type="radio" value="3" />dictionary<br />
<input name="rb" type="radio" value="4" />wikipedia<br />
<input name="rb" type="radio" value="5" />whois<br />
</form>

No Comment

Comments are closed.

Posting your comment.

  • Search

    (Get this form)

    this blog
    my photos
    bugmenot
    dictionary
    del.icio.us
    eBay
    google
    google maps
    google scholar
    med dictionary
    pubmed
    rotten tomatoes
    whois
    wikipedia
  • Fight Referrer Spam

    .htaccess v.03/29/10
  • Recent Tweets

    • Beyond tired of looking at real estate. Maaaybe will make an offer on a house this week and put this long ordeal to rest. 4 days ago
    • On this, my 37th hour of continued wakefulness, I seem to have caught meself a case of the drowsies. 1 week ago
    • @kidney_boy I always thought computer on wheels (COW) was better than the alternative: computer on casters (COC). in reply to kidney_boy 1 week ago
    • If you want to experience eternity efficiently, stand in line to purchase something at a Babies R Us on a Saturday night. 2 weeks ago
    • Pathologists! Always finding new ways to aggravate me. 3 weeks ago
    • Baby 1 - Parents 0. (Well played, you little hooligan.) 2010-08-03
    • More updates...

    Powered by Twitter Tools

  • Be the match

  • Recent Photoalbums



    Galapagos
    (11/2008)



    Peru
    (11/2008)



    Taiwan
    (03/2008)



    Japan
    (05/2007)
  • Archives

  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Unless specifically noted otherwise, all of Aaron Logan's creations found on Loblogomy, LIGHTmatter, and PHOTOSHOCKED (including text, photographs, and any other original works) are licensed for royalty-free use under this Creative Commons Attribution 2.5 License.
Wordpress theme Spotlight