I know dozens of people have probably already done this, but I’m quite happy with myself for having figured it out in ~5 minutes.
Ever since I migrated my blog over to WordPress, I’ve had a little dropdown box in the right column that contained a list of my post categories. Well, that box never actually did anything. There was no form associated with it and no javascript.
Well, I finally buckled under and figured out the javascript. The code in question to make the category box automatically jump to the desired category search is something like this:
<?php
dropdown_cats( 1, "All", "name", "asc", 0, 0, 1 );
?>
<script lang='javascript'><!--
var dropdown = document.getElementById( "cat" );
function onCatChange() {
location.href = "/blog/category/"+dropdown.options[dropdown.selectedIndex].innerHTML+"/";
}
dropdown.onchange = onCatChange;
--></script>
Of course, if your url scheme is different, you might need to specify something slightly different for the destination. But the point is, this works so far as I’ve tested it, and it was pretty painless to drop into place.