Hello
I hope there is someone out there that can guide me in the right direction...
I have a PDF that has text fields that a user would fill out. After its completed I would like to lock all the fields to read only BEFORE it is submitted via e-mail. That part I have figured out. The problem is, when the PDF is opened when the e-mail recipient receives it, all the fields are editable again. I have tired different ideas on how to lock it, but none work.
Here is what I believe will work, but I don't know how to script it. When the document is opened, in the initialize event, I would like to write a script that looks at TextField1 to see if there is any data in there. If TextField1 is blank, the the PDF can be edited. If the TextField1 has any data, then the PDF is locked.
Here is a sample of what I mean:
------- form1.Page1.TextField1::initialize: - (JavaScript, client) --------
var LockTest=(TextField1).value
{
if (LockTest!="") /* Checks the TextField1 for any data */
myScriptObject.LockAllFields(form1); /* if there is any data, lock the form */
else
app.alert(cMsg="Ready for edit",3,0); /* if there is no data, lets begin editing */
}
I have been playing with this for a few days and think I might be onto something. The only problem is, when there IS data in the field, the script doesn't see it and keeps the form unlocked.
Any ideas as to what I am doing wrong?
Thanks