Hi forum,
I would like to know if anyone have any idea on how to stop the whole form from executing any event when it is digitally sign.
The only idea I have is to create a checkbox which is checked when the form is locked and then input an if statement within each events... but that is not really the best method...
What scripts do the scripts on your Initialize and Calculate events are you running?
Views
Replies
Total Likes
On initialize event I change language EN/FR and calculate event changes the visibility of subforms...
When digitally sign nothing can be altered anymore, but when the form is re-opened all the code executes.
Even if nothing in the form changes at all, the form is considered altered for setting values even if it's setting them the same value they were...
Views
Replies
Total Likes
What do you base the change on the Initialize event on? are you just automatically changing it to french? You may have to set a state for the form. Something that will be read by the initialize event and not make the change once it is already set.
Right... I guess I should have done this way before...
at this moment, I just set the value according to the language previously set when saved... maybe I should have a general function to verify if it needs to be set, hopefully this is gonna do the trick..
Thanks
Although any other ideas are welcome... it would be best to prevent all events from executing in case someone enters a field and exit or click anything... I can't believe a digital signature does not handle this behavior...
Views
Replies
Total Likes
You can check the state of a signature field through a script an use the result to control if other script to be executed or not.
// Get the state of the signature field.
// NOTE: In XFA forms this works only by using getField() method with full SOM expresion, so keep the accessors [0]!
var oSignInfo = event.target.getField("form1[0].#subform[0].signature[0]").signatureInfo(),
iSignState = oSignInfo.status;
// Execute only when form is unsigned
if (iSignState === 0 {
// enter your code here
…
}
Status Code Meaning
-1 Not a signature field
0 Signature is blank
1 Unknown status
2 Signature is invalid
3 Signature of document is valid, identity of signer could not be verified
4 Signature of document is valid and identity of signer is valid.
Views
Replies
Total Likes
Hi radzmar,
Thanks for taking time to answer to this issue, I've tried multiple times before to use a similar method to get a signature field status with XFA dynamic forms. The only thing I ended up receiving was a message saying for security measures it can't get signature status as if it needs a trusted function...
the code it's executing is the following :
Am I missing anything?
Views
Replies
Total Likes
If getField() returns null, the SOM couldn't be resolved this method. This is propably because digSignature.somExpression returns a somExpression beginning with xfa[0].form[0].…. Enter a SOM expression beginning with the root node of your form (i.e. form1[0]).
Views
Replies
Total Likes
Alright I got it to work now... but not entirely
It seems to work only on the execution of the second initialize of the form, afterwards it still returns null.
Either in a click, initialize or calculate event, the getField returns null each time, it only returns the current signature status when the form is opened and initialize is fired twice because I execute initialize event of the form on docReady...
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies