Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

Intercept and cancel a digital signature...

Avatar

Former Community Member
Sorry about all of the questions today. This should be the last one.

Here's what I want to do:



- A user clicks on a digital signature field in the form

- Validations occur to ensure that required fields are filled in before

performing the signature.

- If validation is successful, the signature process can continue. If

validation fails, the signature process should be cancelled and an error

message should be displayed indicating what was wrong.



The 'click' event occurs after you have already stepped through the

signature process, so that is too late. The 'mouseDown' event seems to

be a good place to perform the validation, but I have yet to find a way

to cancel the signature process if the validation fails.



Any ideas, or am I just out of luck?



Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com
2 Replies

Avatar

Former Community Member
It is possible that I have found a solution to this problem, but not exactly as you wish.



Think about a dynamic form that it has two form objects, a text field and a signature field. Only when the text field are filled, the form can be signed.



The example:




On Signature's Field Mouse-Enter event:






// Getting the text field object





var txtField = xfa.resolveNode("Formulario1.#subform[0].CampoTexto1");





// Doing a simple validation.





if(txtField.rawValue == null){



   this.access = "readOnly";



   app.alert("Error message");



}else{



   this.access = "";



}




If the text field object isn't filled correctly the access attribute of the Signature Field is changed to readOnly.




On Signature's Field Mouse-Exit event:




this.access = "";




It is very important that you remove the readonly value when the MouseExit event is executed in order that you could accede to it again later.




Though this one isn't the best solution, I hope this help you.

Dan

Avatar

Former Community Member
i'm doing that right now but is there any better solution?