SID-00980: Standardized document naming based on input field
| Status: |
Answered |
TWiki version: |
4.3.2 |
Perl version: |
5.8.8 |
| Category: |
CategoryForms |
Server OS: |
CentOS Linux kernel 2.6.18-128.el5 |
Last update: |
15 years ago |
I have an input field into which I'd like users to enter a ticket number. This would then generate a pile of topics to document that ticket. I am using the TOPICCREATE Plugin to create all of the documents, but I want to name the originating documnent something more than what is entered into that text field.
So, if the user enters ticket number 26262, it should create :
That is the base document, which is created from a template (SD020Template), and it has all of the requisite
TOPICCREATE{} entries in it to establish the topic pile.
The only problem I have is the naming of the base document.
<form name="newticket" action="%SCRIPTURLPATH{"edit"}%/%WEB%/">
<input type="hidden" name="templatetopic" value="SD20Template" />
<input type="hidden" name="onlynewtopic" value="on" />
Ticket Number: <input type="text" name="ticket" size="40" />
<input type="submit" class="twikiSubmit" value="Create" />
<input type="hidden" name="topic" value="SD020XxxYyyR !!! Somehow get the value from the field here !!! ">
</form>
--
RonSiven - 2010-09-24
Discussion and Answer
Use JavaScript to pull a value from the
ticket form field and compose the value of the
topic field accordingly. Consult JavasScript docs or look at the raw text of
TWikiRegistration for inspiration.
--
PeterThoeny - 2010-09-25
That solves my problem perfectly. I can see myself using this technique many times over. Thanks alot!
--
RonSiven - 2010-09-27
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.