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
--
AndyThiel - 05 Feb 2007
Answer
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.
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