Expand my Community achievements bar.

Javascripting conditional signature fields

Avatar

Level 1

Good day all,

I'm trying to create a conditional signature block so that if I have four signers on a form, then they will all be required to fill in Date and Name once signed, but if only one, two, or three sign, then only the amount signing the form will be required to fill in Date and Name.

 

Is this possible using conditional javascript?

 

Thank you!

4 Replies

Avatar

Level 10

Hi there,

 

this seems to be a bit confusing... You should be able to create your own conditions and statements, if I provide you the JavaScript code to verify if a signature field is signed.

 

//Use this with signature field within the formReady event (checks if field is signed only when form is opened or re-layout) [event.target.getField("form1[0]...")]
var oSignInfo = event.target.getField("form1[0].Page1[0].frmSignature[0].digSignature[0]");

//This function can be stored in a script object
function getSignatureInfo(oSignInfo){
        //Variable to retrieve the value signatureInfo().status... if it returns 1 then the field is signed
	var iSignInfo = oSignInfo != null ? oSignInfo.signatureInfo().status : -1;
	return iSignInfo === 1;
}

 

It will require from you to test various situations to ensure that it behaves the way you want it to be...

There's a way to have the signature field checked once the field is signed, but if you do so, it will require the user to save the form once again.

 

Avatar

Level 4
Your signing flow may have a little problem. If you sign a document in the signature field and AFTER that fill further fields, the new content of these fields are NOT part of the signed version of the document.

Avatar

Level 4
The other issue is that a signature field normally blocks all other fields and buttons once signed to prevent modification thereafter. You need to turn "Lock Fields After Signing" off to allow subsequent input - but that will allow final versions of your document which may differ. How do you determine the number of required signers? Are you placing n Blokcs in the design?

Avatar

Level 4

At this link I have a sample form which may or may not be what you need. https://documentcloud.adobe.com/link/track?uri=urn:aaid:scds:US:89265b19-1ffc-4903-bae1-380e012d1b59

 

Note: I turned field locking off for all signatures so that your approach works. You need to check if the open fields are conform with your signature policies.

You basically make a copy of each signingBlock subform for every signer.

I use submit by email for testing - that is the fastest to see if the logic works prior to submitting the form.

You can move the logic to preSave if you are not submitting.

See if that helps...