Auto generate a number and prevent it from updating when the form is opened
Hello
I've created a form which will be uploaded to our intranet, the form has a field which automatically generates a random number when the form is opened, that works well but, the number changes when the file is saved or opened.
Initially the code was in the document processing so ran when the form was opened, I've now deleted that and added the code to the field itself but it's still changing if the user goes into the field.
This is the code I've used
this.getField("RefNo").value = util.printf("%06d", Math.floor((Math.random() * 1000000) + 1));
It's set on a mouse up action and the locked option is also selected.
I want the number to generate when the form is opened and then lock so it doesn't change when opened again, can this be done?
I'm used Adobe Acrobat Pro 9.
Any help would be appreciated.
