[Theforum] Re: quick thought on our search boxes

aardvark roselli at earthlink.net
Sat Jan 12 13:35:23 CST 2002


> From:           	"Warden, Matt" <mwarden at mattwarden.com>
[...]
> 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:
[...]

i don't buy that at all... JS is completely unnecessary...

the three searches in the sidebar go to pages on the same site, 
with these paths:

Article:
/search/index.html

Comments:
/comment/search/index.html

User:
/user/index.html

assuming i were coding this in ASP, i'd take all three searches, 
stuff the full contents of the code required to do those searches 
into three seperate include files, and call those includes in one 
master page...

that page would be broken down into SUBs (or however you want 
to do it) and the value of the radio button would choose which SUB, 
and hence, which search, to perform...

pseudo-code:

if radio = "article" then
	SUB article
elseif radio = "comment" then
	SUB comment
elseif radio = "user" then
	SUB user
end if

and each sub would be something *like*:

SUB article
 <!-- include "/search/index.html" -->
END SUB

does this make sense at all?

i've built a number of sites with disparate searches that i've brought 
all into one form and one results page, while still maintaining the 
original code...

JS is not necessary by any stretch...





More information about the theforum mailing list