Tags:
create new tag
view all tags

SID-00980: Standardized document naming based on input field

Status: Answered 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 :

  • SD020XxxYyyR26262

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

      Change status to:
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.
SupportForm
Status Answered
Title Standardized document naming based on input field
SupportCategory CategoryForms
TWiki version 4.3.2
Server OS CentOS Linux kernel 2.6.18-128.el5
Web server Apache 2.2.3-22.el5.centos
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2010-09-27 - RonSiven
 
  • 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.