Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

blocking printing the form until mandatory fileds ar filled with data

New Here ,
Mar 15, 2017 Mar 15, 2017

Ist there a way to prevent printing a form until required data are filled into mandatory/compulsary fields?

TOPICS
Acrobat SDK and JavaScript
300
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 15, 2017 Mar 15, 2017

Depending on how big your warning field is, it may interfere with the filling out of the missing data. That's why I would hide the field (as I said, I would plaster it in big letters across the whole page). Hiding it again also makes sure you don't have to add any logic that hides it when the form is completely filled out.

Translate
Community Expert ,
Mar 15, 2017 Mar 15, 2017

No, but you can make the print unusable by adding e.g. a page filling form field that adds  "NOT COMPLETE" across the page. You would create this field and then hide it. In the "Document Will Print" action, you would show it, and in the "Document Did Print" action, you would hide it again.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2017 Mar 15, 2017

Thank you for you quick replay

The mandatory fields are "internalAddress" and "refenceNumber"

The filed "intrnalAddress" contains the initial text "Interne Versandadress"which the use has to replace by a current address.

The field "referenceNumber" is initially empty

The field "warning" contains the text "NOT COMPLETE" across the pabe.

I added the follwing script to the"Document Will Print" action

var ia = this.getField("internalAddress").value

var rn = this.getField("referenceNumber").value

if (ia == "Interne Versandadresse" || rn == "")

this.getField("warning").display = display.visible;

else this.getField("warning").display = display.hidden;

As I can see it works.

Why I should hide the warning field in the "Document Did Print" action?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2017 Mar 15, 2017
LATEST

Depending on how big your warning field is, it may interfere with the filling out of the missing data. That's why I would hide the field (as I said, I would plaster it in big letters across the whole page). Hiding it again also makes sure you don't have to add any logic that hides it when the form is completely filled out.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 15, 2017 Mar 15, 2017

It's possible to some extent... You can't prevent the file from being printed entirely, but you can force it to print without any of the data in the fields or with a large error message.

I've developed a script that allows you to do that. You can find it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines