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
--
FredanLangam - 15 Nov 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.
--
FredanLangam - 22 Nov 2007