Skip to main content
Participating Frequently
April 22, 2025
Question

Prompt error - for Text Field checker for empty fields

  • April 22, 2025
  • 1 reply
  • 262 views

Hi 

Would like to ask, I tried using the other solution https://community.adobe.com/t5/acrobat-discussions/empty-fields-notification-script-on-a-pdf-form/m-p/10010427 and https://community.adobe.com/t5/acrobat-discussions/empty-fields-notification-script-on-a-pdf-form/m-p/10010427 but it seems only the first "Approximate1" text field are being recognized. 

on my document, what did i do wrong? 
Also, is there a better way around instead of using checkbox as trigger for checking the text field blanks?

Thanks in advanced.

1 reply

Thom Parker
Community Expert
Community Expert
April 22, 2025

No, you don't have use a check box to trigger the checking script. It could be a button. But if you are going to use a checkbox, then it should have some meaning. Right now it does the same thing whether the box is checked or not. 

 

The error in the script is this line:

var f = this.getField(fields);

 

The variable "fields" is an array of field names.  So to get a specific name the code needs to access a specific index.  Like this:

 

var f = this.getField(fields[i]);

 

BTW: in this code "f.name" is exactly the same as "fields[i]"

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often