Tags:
create new tag
view all tags

Question

Im using TWIKI 04 Wed, 08 Feb 2006 build 8740.

I want to use a HTML form that returns to the calling page including one URL parameter, like this:

<form method=\"post\" action=\"%SCRIPTURLPATH{view}%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?index=%URLPARAM{\"index\"}%\"...

If I do this, I will see the correct URL, including the parameter index e.g.

.../MyTopic?index=1234

in the browsers link field. But inside the page the

%URLPARAM{"index"}

is not set to 1234. If I go and just call the page agian by hitting return on the link field in my webbrowser everything is fine, however. Where is my mistake?

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server: Apache
Perl version: 5.8.5
Client OS: Win XP
Web Browser: MS Explorer 7.0
Categories: Forms, Missing functionality, Contributing code

-- AndyThiel - 05 Feb 2007

Answer

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.

This here should work:

<form method="post" action="%SCRIPTURLPATH{view}%/%INCLUDINGWEB%/%INCLUDINGTOPIC%">
<input type="hidden" name="index" value="%URLPARAM{"index"}%" />
<input type="text" name="something_visible" value="" />
</form>

-- PeterThoeny - 05 Feb 2007

Hi Peter thanks for the quick answer, it works perfect! Is there any place in documentation where I'm supposed to find things like this? Anyhow, I still like to have the

<form method=\"post\" action=\"%SCRIPTURLPATH{view}%/%INCLUDINGWEB%/%INCLUDINGTOPIC%?index=%URLPARAM{\"index\"}%\"...
with the parameter, just to have a web address that can be copy-pasted. Or is this potentially harmful?

-- AndyThiel - 05 Feb 2007

Just one last question: Is there any way to achieve the same using save instead of view CGI script? I want to use the beforeSaveHandler in Plugins, but after save the page including the ?index=1234 parameter shall be displayed. Do I need to use the new redirectto option of save?

-- AndyThiel - 05 Feb 2007

Along these lines, I am trying to pass get parameters to a redirect URL. Example: When I click on a form button, I want the action performed and then a redirect to "NewTwikiURL?param=value". What happens now is the extra parameters are URL encoded and TWiki tries to make a new topic with all that stuff in it versus passing the parameters as actual parameters to the redirectto topic.

-- JasonLuttgens - 20 Feb 2007

Set the redirectto parameter to the entire url to bypass the encoding like this:

redirectto="%SCRIPTURL{view}%/%WEB%/YourTopicName?param=value"

-- DewayneVanHoozer - 03 Aug 2007

Closing; seems to be answered.

-- PeterThoeny - 02 Dec 2007

Change status to:
Edit | Attach | Watch | Print version | History: r6 < r5 < r4 < r3 < r2 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r6 - 2007-12-02 - 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.