Tags:
create new tag
, view all tags

Question

I've been puzzling over how to create a form that users can fill out and then submit to search TWikiForms metadata, and I figure it's time to ask for help rather than continue banging my head against the wall.

To be specific, I have a web where every topic has a DocumentationForm with several fields, one of which is DocumentType. The DocumentType can be Guideline, Process, Policy or Reference.

I want to create an HTML form where users can select which DocumentType they want to search for, hit submit, and get a list of all the topics in that web that have DocumentType=Guideline.

I've looked at similar pages such as the TWikiInstallation page, browsed the SearchPatternCookbook, and read up on HTML forms, but so far I'm still unable to put it all together to create my search. In particular, I'm confused by the role of URL parameters and the form "action" attribute.

Any help would be greatly appreciated.

Environment

TWiki version: TWikiRelease04x02x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms, Search

-- GarySprague - 15 Mar 2008

Answer

ALERT! If you answer a question - or have a question you asked answered by someone - please remember to edit the page and set the status to answered. The status is in a drop-down list below the edit box.

Here are the steps in pseudo code:

  • Create an HTML form that has a pick list of the document types
  • The form action is the very same page, e.g. you land at the same page with the form fields as URL parameters
  • Create a %SEARCH{}% in the page that takes the URL parameter as part of the search criteria.

Let's make a small example, a form that asks for the support status of topics in this web, and a SEARCH showing the last 10 results of the selected state. Look at the raw text to see how this works.

Select support status:

(Note that TWiki 4.2 has an easier QuerySearch than the regular expression search in TWiki 4.1.2 installed here on twiki.org.)

-- PeterThoeny - 05 Apr 2008

Peter,

Thanks for your reply. Since I posted this, I found some good examples on the Sandbox web and was able to piece together the main steps and then take it from there. But hopefully these instructions will be helpful to others just starting out.

-- GarySprague - 07 Apr 2008

 
Change status to:
Topic revision: r3 - 2008-04-07 - GarySprague
 
Twitter Delicious Facebook Digg Google Bookmarks E-mail LinkedIn Reddit StumbleUpon    
  • Download TWiki
TWiki logo Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2012 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.