Skip to main content
brookec43111379
Participant
October 27, 2018
Answered

2 QUESTIONS - how to make ghost text and user data BOTH visible but ONLY user data prints? How to get automatic warning to complete incomplete fields before document is printed?

  • October 27, 2018
  • 1 reply
  • 1989 views

Hi all,

I am creating (or trying to create) a fillable form and I want users to be able to see  “example” text in the field, but i don’t want the example text to print – I only want data the user enters to print. At the moment I have used this custom format script

if (event.value==""){event.value="insert address here"}

however the example “insert address here” prints if the user doesn’t enter data. Is there any way I can change that so that it DOESN'T print UNLESS the user enters data (i.e. if the user does NOT enter the address, then NOTHING will print in the field)?

The idea being that the field would display "insert address here" when the form is opened.

if the user inputs "35 Something Street:" then the field would print with "35 Something Street:"

if the user inputs nothing, the "insert address here" text would still be visible but would not print

The second question I have is, is there any way I can prompt/warn a user to complete required fields before they print?

For example, when they go to print the document (through the usual process), if there are required fields that only have the example text (i.e. "insert address here") the user gets a warning or something that says “field A, field B, field H must be completed” (with "field A" displaying as the field name in the text field properties general tab)

I understand from reading through many forum posts that I can’t prevent a user from printing the document (or make the document print blank) if they haven’t completed all the required fields (which would be my preference) however if I can do something to ensure that a prompt comes up telling the user which fields need to be completed (and ideally, highlight those fields so they are easily identifiable) that may solve the problem.

If it is possible to also highlight the fields that aren't completed after the warning is given (i.e. "address field" is blank - you must input data" and then the address field (in the above example, the field with the example text "insert address here") would be highlighted in red or something. The only thing is I don't want the highlight to print - I only want the field to be highlighted UNTIL text is entered. Is that possible?

I have no real understanding of script writing etc. so I am finding this very challenging! Any help would be GREATLY appreciated!!

This topic has been closed for replies.
Correct answer try67

There are plenty of code samples on these forums about how to validate the required fields and then display a message if they are not all filled-in. You can only prevent the file from being printed if they use a button that you added to it, not if they use the built-in Print command, though. It is possible to force it to print as a blank copy.

I've developed a (paid-for) tool that allows you to do all of that quite easily. You can find it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving

1 reply

Inspiring
October 27, 2018

For #1, you can use a custom Format script, like:

// Custom Format script for text field

if (!event.value) {

    event.value = "Instructional text goes here";

    event.target.display = display.noPrint;

} else {

    event.target.display = display.visible;

}

brookec43111379
Participant
October 27, 2018

Thank you!!!!!

Any chance you know how I can address the second part?

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 27, 2018

There are plenty of code samples on these forums about how to validate the required fields and then display a message if they are not all filled-in. You can only prevent the file from being printed if they use a button that you added to it, not if they use the built-in Print command, though. It is possible to force it to print as a blank copy.

I've developed a (paid-for) tool that allows you to do all of that quite easily. You can find it here: Custom-made Adobe Scripts: Acrobat -- Validate Required Fields Before Printing or Saving