SID-00920: Dynamic search string
| Status: |
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
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.