Tags:
create new tag
, view all tags

Question

I want to offer a form in one web to create a topic in another: in my example I want to lead the people directly to the editing in the Bugs-Web.

I already produced some code but well, I know it can't work but perhaps someone else already did sth. like this?!

<form action="" name="newform">
<select name="web" size="1" tabindex="12" >
%WEBLIST{"<option  value='$name'>$name</option>"  separator=" "}
<input type="hidden" value="Bugs.BugsDescriptionTemplate" name="templatetopic"/>
<input type="hidden" value="on" name="onlywikiname"/>
<input  type="submit" class="twikiSubmit" tabindex="13" value="Create Bug" />
</form>

Environment

TWiki version: TWikiRelease04x00x00
TWiki plugins: DefaultPlugin, EmptyPlugin, InterwikiPlugin
Server OS:  
Web server:  
Perl version:  
Client OS:  
Web Browser:  
Categories: Forms

-- MarijanaPrusina - 15 Jun 2007

Answer

ALERT! 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.

I believe what you want to do is populate the form's 'action' property with the web and script that you want called. You'll also want an input with name="topic"...

<form name="newform" action="%SCRIPTURLPATH{edit}%/Sandbox">
<select name="web" size="1" tabindex="12" >
%WEBLIST{"<option  value='$name'>$name</option>"  separator=" "}%
<input type="text" name="topic" size="20" />
<input type="hidden" value="Bugs.BugsDescriptionTemplate" name="templatetopic"/>
<input type="hidden" value="on" name="onlywikiname"/>
<input  type="submit" class="twikiSubmit" tabindex="13" value="Create Bug" />

In this example the 'topic' field is a text box that will allow a user to enter a value. This will fail during creation if they don't enter a wikiname since you have that set as one of your parameters. You can either let this go, remove the requirement for a wikiname, or have the topic name generated automatically. You could also write some javascript to convert a normal title with spaces and english capitalization to wikiname. That gets a little more hairy as you can imagine.

Good luck.

-- MatthewCardozo - 26 Jun 2007

-- MatthewCardozo - 26 Jun 2007

 
Change status to:
Topic revision: r2 - 2007-06-26 - MatthewCardozo
 
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.