Tags:
create new tag
view all tags

SID-00920: Dynamic search string

Status: Answered Answered TWiki version: 5.0.0 Perl version:
Category: CategoryJavaScript Server OS: CentOS Last update: 15 years ago

I'm trying to allow the user to specify a query search. My strategy was to create an input form that would pass the query fields via URL parameters. Then javascript would assemble them into a query string "Subject ~ 'test' AND Name ~ 'John'" and pass them to %SEARCH{}%. However, try as I might, I cannot get the assembled query into %SEARCH{}%. I can't figure out how to set a TWIKI variable from within JavaScript, and when I pass the query string as a URL parameter the quotes are turned into URL codes and mess up the search. Haven't been able to find any solutions on the web. Suggestions? -djs

-- DavidSturman - 2010-08-01

Discussion and Answer

I figured it out. I can either use the method in the TWikiInstallation topic, or make sure that I use %URLPARAM{}% with encode="quote". The latter solved my problem of URL character codes in my search string.

-- DavidSturman - 2010-08-01

I am glad it worked out. Yep, use URLPARAM to glue a filter form and SEARCH together for an AND query.

-- PeterThoeny - 2010-08-05

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Dynamic search string
SupportCategory CategoryJavaScript
TWiki version 5.0.0
Server OS CentOS
Web server Apache
Perl version

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2010-08-05 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.