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 (old) photos
    my (new) photos
    bugmenot
    dictionary
    del.icio.us
    eBay
    google
    google maps
    google scholar
    med dictionary
    pubmed
    rotten tomatoes
    whois
    wikipedia
  • Fight Referrer Spam

    .htaccess v.08/23/09
  • Recent Tweets

    • .@ConanOBrien I'm a hematologist, not a dermatologist, but looking at that, I give you 7 months. Don't worry. That's a really long time. 1 day ago
    • The most disturbing part of this story is that PETA once lobbied Ben and Jerry's to use human milk to make ice cream. http://ow.ly/1gmQj 1 day ago
    • The user interface is a bit clunky, but this golden hour calculator could be useful for photographers. http://ow.ly/1gmMF 1 day ago
    • Speaking of infographics, with Ed Tufte on the Recovery Advisory Panel, we'll see some slick gfx of taxpayer enshaftment. http://ow.ly/1fPQX 2 days ago
    • Breasts: The Infographic http://ow.ly/1fPKM 2 days ago
    • More updates...

    Powered by Twitter Tools.

  • Be the match

  • iPhone Photoblog

    www.flickr.com
    This is a Flickr badge showing public photos from iphonepics. Make your own badge here.
  • 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