How to get PDF to auto generate new number every time it is opened as long as the field is blank
I am brand new to JavaScripts. I have never done one before. I am familiar with VB in excel and modifying macro's but that is about it.
I have a PDF document that I need a new number generated every time the document is opened as long as the field is blank.
I have this script but have no idea if it is correct or if I am missing something:
if (this.getField("IA-").value == this.getField("IA-").defaultValue) {
this.getField("IA-").value = util.printf("%06d", Math.floor((Math.random() * 1000000) + 1));
}
I want the number to generate IA-001 or IA-002 etc etc in a certain area of the document
I have opened Document JavaScripts and pasted the above as a new script but that doesn't seem to do anything. A screen shot of what I have to do or some assistance with the document would be much appreciated.
Thank you very much!
