Tags:
create new tag
, view all tags

Question

How do you pass a javascript variable so its value can be read/accessed by a TWiki function?

The idea behind all this started with the user's input in an HTML form field. The input consists of 3 digits with the format xxx e.g. 015. Upon form submission, the said number is prefixed with something like "Machine." Hence, the topic name for machine 015 is Machine015. (Obviously, I could have done this using an auto-incremented number but I have to implement it first through manual means since my team will be migrating data from an Excel worksheet into our workgroup website.) Aside from assigning a prefix, I also want to check for the existence of the topic (e.g. Machine015) upon form submission using EXISTS spreadsheet function to ensure that existing topic is not overwritten as the case stated in HowToPreventTemplateToOverwriteExistingTopic. Basically, I want to do it in another way by preventing the form submission and displaying a message to the user that the entered number is already in use by a machine. The prefixing is coded in a javascript function which is called in the form's onsubmit() event. I want to add the checking in the function but don't know how to pass the javascript variable to TWiki's EXISTS function. Any idea how to do this?

If you have a better way, that is also very much welcome.

Environment

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

-- FredanLangam - 15 Nov 2007

Answer

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.

-- FredanLangam - 22 Nov 2007

Change status to:
Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r2 - 2007-11-22 - FredanLangam
 
  • 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-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.