[Theforum] Re: quick thought on our search boxes

Warden, Matt mwarden at mattwarden.com
Sat Jan 12 13:20:54 CST 2002


amanda asked:
>Wouldn't the radio buttons provide the correct distinction for the
>search engine?

Because of how the site is architected, the location of the logic to
determine what search to perform would be ugly. It's difficult to explain
without showing you the code, but when you have a URL like this:


/user/index.html?keywords=foobar

The first thing that happens is that a switch is performed on the
"user" section and processing of what do do from there (show a user
page? search for possible matches? etc.) is performed in another file.

So, in order for one to use a single search form, the action url of the
form would depend on the radio buttons. We'd have to do some whack
javascript or something in order to avoid restructuring how things work on
the backend. It'd have to be something like this:

<form>
...
<input type="button" onClick="submitMe(this)">
</form>

<script ...>
function submitMe(oForm)
{
	window.location = "/"+ oForm.searchType.value
+"/index.html?keywords="+ escape(oForm.keywords.value);
}
</script>

So, the searchType radio button group would determine what is in place of
"user" in the url example I gave you above.

I'll yeild to jeff on the feasability of *this* approach, keeping in mind
that we don't want to use javascript that would *completely* take out the
functionality for a percentage of our users.

In my mind, I'd rather have a cluttered sidebar and use html forms which
everyone can use than have a compact search form that only 80% of whatever
of our users can use.

Thanks,

--
mattwarden
mattwarden.com





More information about the theforum mailing list