Skip to main content
kelseyg79295017
Participant
August 7, 2017
Answered

PDF Form Text Field

  • August 7, 2017
  • 1 reply
  • 716 views

I am trying to make a PDF form that has a variable text field.  The variable text field needs to have instructions in it.  If the user doesn't enter anything, I don't want those instructions to print.  But if they do enter content, I want that content to print.  Does anyone have a solution for this?  My solution right now is to create two layers, with the lower layer having the instructions and being "visible but doesn't print", but there has to be a more sophisticated option.  Any thoughts are appreciated!

This topic has been closed for replies.
Correct answer George_Johnson

I use a custom format script for this, something 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;

}

1 reply

George_JohnsonCorrect answer
Inspiring
August 7, 2017

I use a custom format script for this, something 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;

}

kelseyg79295017
Participant
August 7, 2017

Thanks, George! I'm not entirely sure where to put that code though, can you be a little more specific?  Thank you!

Inspiring
August 8, 2017

On the format tab of the field properties dialog, select a Format Category of "Custom" and you'll see where you can enter a custom format JavaScript.