[Zope] site search

Tres Seaver tseaver@palladion.com
Fri, 10 Dec 1999 12:39:41 -0600


Rob Page <rob.page@digicool.com> wrote,

> "'Timothy Wilson'" <wilson@visi.com>:
> 
> > I'm trying to implement a search feature on my site. Basically, I've
> > created a form for searching with two radio buttons, one for
> > searching the
> > Internet and the other for searching my site with ZCatalog.
> > Do I need to
> > use any DTML trickery here or can I easily get the form to direct the
> > action to different places based on which radio button is selected? I
> > really hope this isn't some really obvious HTML question, but I hunted
> > around and I can't find a good example or any easy answers. Thanks.
> 
> You can either send the form to the same ACTION and then break that
> action up with something like:L
> 
> <dtml-if radio_button1>
> ..
> 
> or you can use some javascript.  Basically, change the submit button
> from type=submit to type=button and make it run a javascript function.
> You can then, at runtime modify the ACTION of the form and then send it
> to the server.

If a radiobutton is not a hard-and-fast requirement, you can also make the
form's ACTION point to your main object, and then have multiple SUBMIT buttons
-- use the ":method" decoration on their NAME attributes to select a method to
be called:

  <FORM ACTION=frobber METHOD="post">
    ....
    <INPUT TYPE="submit" NAME="frob_once:method" VALUE="Once"=
    <INPUT TYPE="submit" NAME="frob_twice:method" VALUE="Twice"=
  </FORM>

-- 
=========================================================
Tres Seaver         tseaver@palladion.com    713-523-6582
Palladion Software  http://www.palladion.com