Tags:
create new tag
, view all tags

Question

Hi

I just created a nice search topic looking like this:

<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Main/%TOPIC%">
Find Topics: 
<input type="text" name="q" size="32" value="%URLPARAM{"q"}%" />
<input type="submit" value="Search" />
</form>

%TABLE{tableborder="0" columnwidths="10%,20%,50%,20%" dataalign="left,left,left,right" 
headeralign="center" cellpadding="3" headerbg="#F3EDE7" headercolor="#000000" databg="#ffffff, #f8f8f8"}%
|*Web*|*Topic*|*Summary*|*Changed on*|
%SEARCH{ search="%URLPARAM{"q" default="-"}%" scope="all" web="all" type="keyword" 
format="|$web|[[$web.$topic][$topic]]|$summary|$date|" nosearch="on" nototal="on"}%

Now, I'd like to create a form field in my WebLeftBar topic to call this page:

<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Main/QuickSearch" method="post">
<input type="text" name="q" size="12" value="" /><input type="submit" value="go"></form>

Well, it doesn't work. All it does is displaying the topic you're on, with a "?q=query" added in the URL.

I tried to do the same in the sandbox, creating a new topic, and that one worked fine.

What's wrong?

Thanks a lot in advance

Environment

TWiki version: TWikiAlphaRelease
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS: solaris 8
Web server: apache 1.3
Perl version: perl 5.8.4
Client OS: Mac OS X
Web Browser: firefox 1.0 rc

-- AndreBonhote - 16 Sep 2004

Answer

I assume that "query" did not appear in the input box?

You could try it without method="post" I'm not sure it will make a difference though.

-- SamHasler - 16 Sep 2004

Look at the HTML source of a page with PatternSkin and you will see that the sidebar is already enclosed in a form. So you are creating a form in a form which does not work.

Workaround (hack) : Close the existing form, then open your form (but don't close your form)

</form>
<form action="%SCRIPTURLPATH%/view%SCRIPTSUFFIX%/Main/QuickSearch" method="post">
<input type="text" name="q" size="12" value="" />
<input type="submit" value="go">

The correct fix is to make the PatternSkin configurable. Ask for this in the PatternSkinDev topic.

-- PeterThoeny - 16 Sep 2004

Sam, Peter!

Thanks for your answers. I tried the form closing thing, and it works. Thanks a lot!

Cheers!

André

-- AndreBonhote - 17 Sep 2004

 
Topic revision: r4 - 2004-09-17 - AndreBonhote
 
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.