Skip to main content
Inspiring
October 16, 2023
Answered

Need a second pair of eyes

  • October 16, 2023
  • 3 replies
  • 2507 views

I've constructed an Acroform with both doc- and field- level scripts, including spawning templates. I complete the Acroform and 'Request Signatures'. I'm using Signature and Optional Signature Sign text tags in text fields to capture the signatures. On a couple of the signers I also include a Date Sign tag associated with the signer's signing event. The Acroform functioned without error before I added the Signature workflow. I've spent the last week going around in circles so much so that I'm confused to what I have and have not tried! So I'm asking for mercy from some kind soul to scan the following code. The java console only throws the thisgetField( null .... error code on the signature and date fields.

This is a doc-level script w/a checkbox mouse-up trigger that will hide/show correctly all the non-signature/date fields but fails to show/hide the Optional Signatures.

 

function JointOwnerFields() {
if(event.target.isBoxChecked(0))

{// box is checked

this.getField("RBCoOwnerResident").display = display.visible;
this.getField("RBCoOwnerCitizen").display = display.visible;
this.getField("RBCoOwnerHear").display = display.visible;
this.getField("RBCoOwnerType").display = display.visible;
this.getField("CoOwnerName").display = display.visible;
this.getField("CoOwnerPhone").display = display.visible;
this.getField("CoOwnerEmail").display = display.visible;
this.getField("CoOwnerSex").display = display.visible;
this.getField("CoOwnerDOB").display = display.visible;
this.getField("CoOwnerID").display = display.visible;
this.getField("CkBxSameMailAddress").display = display.visible;
this.getField("CoOwnerMailAddress").display = display.visible;
this.getField("CoOwnerMailCity").display = display.visible;
this.getField("CoOwnerMailState").display = display.visible;
this.getField("CoOwnerMailZip").display = display.visible;
this.getField("CkBxSameCoOwnerMailAddress").display = display.visible;
this.getField("CoOwnerPhysicalAddress").display = display.visible;
this.getField("CoOwnerPhysicalCity").display = display.visible;
this.getField("CoOwnerPhysicalState").display = display.visible;
this.getField("CoOwnerPhysicalZip").display = display.visible;
this.getField("Sig1_es_:signer3:signature").display = display.visible;
this.getField("Dte_es_:signer3:date:format(date,mm-dd-yyyy").display = display.visible;
this.getField("OSig2_es_:signer3:optsignature").display = display.visible;
this.getField("OSig3_es_:signer3:optsignature").display = display.visible;
this.getField("OSig4_es_:signer3:optsignature").display = display.visible;
this.getField("OSig5_es_:signer3:optsignature").display = display.visible;
}
else {

// box is unchecked

this.getField("RBCoOwnerResident").display = display.hidden;
this.getField("RBCoOwnerCitizen").display = display.hidden;
this.getField("RBCoOwnerHear").display = display.hidden;
this.getField("RBCoOwnerType").display = display.hidden;
this.getField("CoOwnerName").display = display.hidden;
this.getField("CoOwnerPhone").display = display.hidden;
this.getField("CoOwnerEmail").display = display.hidden;
this.getField("CoOwnerSex").display = display.hidden;
this.getField("CoOwnerDOB").display = display.hidden;
this.getField("CoOwnerID").display = display.hidden;
this.getField("CkBxSameMailAddress").display = display.hidden;
this.getField("CoOwnerMailAddress").display = display.hidden;
this.getField("CoOwnerMailCity").display = display.hidden;
this.getField("CoOwnerMailState").display = display.hidden;
this.getField("CoOwnerMailZip").display = display.hidden;
this.getField("CkBxSameCoOwnerMailAddress").display = display.hidden;
this.getField("CoOwnerPhysicalAddress").display = display.hidden;
this.getField("CoOwnerPhysicalCity").display = display.hidden;
this.getField("CoOwnerPhysicalState").display = display.hidden;
this.getField("CoOwnerPhysicalZip").display = display.hidden;
this.getField("Sig1_es_:signer3:signature").display = display.hidden;
this.getField("Dte_es_:signer3:date:format(date,mm-dd-yyyy").display = display.hidden;
this.getField("OSig2_es_:signer3:optsignature").display = display.hidden;
this.getField("OSig3_es_:signer3:optsignature").display = display.hidden;
this.getField("OSig4_es_:signer3:optsignature").display = display.hidden;
this.getField("OSig5_es_:signer3:optsignature").display = display.hidden;

}
}

 

This topic has been closed for replies.
Correct answer Thom Parker

Is the name of one of the fields "Dte_es_:signer3:date:format(date,mm-dd-yyyy)"?  If so then that's your errors. it's missing a closing parentheses in the code. 

 

3 replies

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
October 16, 2023

Is the name of one of the fields "Dte_es_:signer3:date:format(date,mm-dd-yyyy)"?  If so then that's your errors. it's missing a closing parentheses in the code. 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Inspiring
October 16, 2023
Where? It's pasted from the guide with the exception of '3' instead of '1'
for the signer designation. Where should it be added? Thank you Thom.-
kemper
Bernd Alheit
Community Expert
Community Expert
October 16, 2023

In the line

this.getField("Dte_es_:signer3:date:format(date,mm-dd-yyyy").display = display.visible;

is the field name correct?

Inspiring
October 16, 2023
Yes, I basically copied the tag from the Adobe Guide. I have tried to put a
number after the 'Dte' ( Dte1) to see if it would correct but it did not.
I've printed all the scripts and checked them against the Field names in
the sidebar in the Prepare Form mode.
Nesa Nurani
Community Expert
Community Expert
October 16, 2023

Can you share your file with us?

Nesa Nurani
Community Expert
Community Expert
October 16, 2023

this.getField( null .... error code means you use a field name in your script that does not exist.

Check your script that all field names are correct.