I'm trying to make a form and I need two things that I cant get to work.
First, A unique number is created in a field on opening the document. This is an action on opening the document made like this:
// Get and Format Date
var currDate = new Date();
var strDate = util.printd("yyyymmddHHMMss",currDate);
// Display date on pages
this.getField("CurrentDocDate").value = strDate
20090913162508 is the outcome
The value it return is the current yearmonthdayhourminutesecond. When saving the document and opening it again e.g. for completing the form, the number is changed. I want it to lock after creating the number.
The second thing is printing.
The document has a few (15) userinputfields, and most of them are required or required if some other value is inserted.
I want to create an action that disallows printing and saving when not all required fields are filled in.
how do I create that?
the options I looked for on this forum did'nt do it for me.
Forgive my english, I'm dutch, and do not have much understanding of Javascript. Starting new. Originally creating the forms in Indesign, but now our customers want these kind of functions added.
I have 9. but it needs to be working with 8
if (this.getField("CurrentDocDate").value==null || this.getField("CurrentDocDate").value=="") {
// the rest of the script
}
That way the field will only be filled once (make sure you set it to read-only, so the user can't change it manually)
2. The user will always be able to print the form through Acrobat, by going to File - Print, or pressing Ctrl+P. You can't prevent that. What you can do is add a WillPrint script that alerts the user if not all data is filled in. You can also create a "Print" button on your form. In that button you can prevent printing if not all data is filled in.
- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com