Skip to main content
Participant
September 19, 2016
Question

validation for client address field

  • September 19, 2016
  • 1 reply
  • 284 views

my pdf form has a field for client information,  ( company name, address, city state and zip ) that is often left blank before printing by my clients , can any one provide me with a script for validating this field with a pop up message before it is allowed to print. 

This topic has been closed for replies.

1 reply

Inspiring
September 19, 2016

If you just want to check that the field is not empty, you can set up your own print button and use a script like:

// Mouse Up script for a button

(function () {

    // If the address field is blank, alert the user

    if (getField("client_info").valueAsString) {

        print();  // Print this document

    } else {

        app.alert("The client information field is empty. Printing will be aborted.", 3);

    }

})();

You'd have to replace the field name in this script with the actual field name. You can also place a similar script in the Document Will Print event so the user is aware that the field is blank, but the print will still take place.