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
--
MarijanaPrusina - 15 Jun 2007
Answer
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.
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