|
Sharon,
This is admittedly a bad solution (or no solution at all), but it is how I have handled the problem of creating unique-identifying numbers for forms. I believe a good solution would involve connecting the form to a database containing a field for the unique form number (which would be incremented and then stored in the database every time the form is accessed). Unfortunately, I have not yet connected any PDF forms to databases.
The following _javascript_ creates a unique number (12-digits) based on the date and time, so the number changes every second and therefore probably produces a unique number, but theoretically two users could access the form at exactly the same time:
var d = new Date(); /* Create a Date object containing the current date. */ var f = this.getField("REQUISITION_NUMBER") f.value = util.printd("yymmddHHMMss", d);
This script is the same except that it produces a shorter number (10-digit) that changes every 10 seconds:
var d = new Date(); /* Create a Date object containing the current date. */ var f = this.getField("REQNO") var str = util.printd("yymmddHHMMss", d); f.value = str.substr(1,10)
The parameters for "substring" are the starting character and one more than the ending character where the first character is numbered zero.
-----Original Message-----
I am new to this list. I have a problem with a fill in PDF form that I've made. My boss wants the form to be on the website and each one that is printed is assigned a sequential number which can never repeat. It couldn't assign a number each time it's viewed, it would actually have to be printed. There won't be a submit button because we're still at the point where we need a physical signature. For example an invoice would each have it's own number that is in order. I know that the first thing to do would be to assign a form field. I have found a form on the web and a random number is assigned but I can't find anything that assigns a sequential one. Is this possible to do within PDF with a _javascript_ or does it need to interact with the server to get the number assigned? Unfortunately, I don't know _javascript_ or any other kind of programming. Any help you could give me would be appreciated.
Thanks, Sharon |
Title: Message
