I have a form filled by a user, signed and sent to a reviewer for him to fill his part and finally sign as well. I want only the respective fieldsto be accessible to each of them.
I used a calculate script to detect the status of the form based on the status property of mySignatureField.signtureInfo().
if user has not signed: unlock users field, clear reviewers field and lock them. (user mode)
if user has signed: lock users field, unlock reviewers field. (review mode)
if reviewer has signed: lock everything
I could have used the built-in "set readonly to fields ****" of the signature field but since I need to unlock others as well, I have to script it manually.
The problem is I call my modeSwitch function in the "do this when saved" section of the signature field but it doesn't trigger, so my modeSwitch script doesn't fire neither by calculation nor by explicitely scripting it, unless I change a value somewhere. I need to mention that when removing the signature, the modeSwitch is called without a problem.
Why is UN-singning a field considered a modification triggering calculate scripts but singning is not?
What is the best way to implement a modeSwitch after signature when you need to both lock and unlock fields?
A work around I'm thinking about is to force the user to switch mode manually before he can use the signature field by adding a "verify my form before signing" button over the signature field that would validate the form, switchMode and reveale the signature field.
Have you looked at a signature field?
Is there a calculate tab for this field type?
If there is no calculation available for this type of field how could it automatically trigger a calculation?
https://forums.adobe.com/Form event processing
It is considered changing because the bit that controls the read write stats has changed. Any change and that means any and all changes negate a previous signature. That also includes adding a different signature. The change is detectable to any change in a single bit if the PDF. A bit is 1/8 of a byte.
Until your form tries to perform a save operation you script will not trigger.
Have you considered a document level script?
I do not see a " "do this when saved" section of the signature field". There is "When signed" action for the signature field. If you use this you need to do all the actions like setting the fields to read only or to make the forms fields modifiable, and calling any document level functions.