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().
Basically:
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.