Skip to main content
Known Participant
November 23, 2010
Answered

PDF Text Field Form Label

  • November 23, 2010
  • 2 replies
  • 46706 views

Hello everyone.  I was wondering if there was a way to make a label viewable in normal mode for a PDF text field form.  I am making my PDF a form with a fillable text box in it.  Well, I'd like the box name to show up when someone opens the PDF, not just if they only go into the edit form view.  I hope I'm making sense.  So far, the only thing I can think of is making a Button with the label above the fillable text box or make the text box a combo box.  However, with a combo box, I can't edit how the text will look when it's typed in.  Right now, though, when a person opens the PDF normally, the highlighted fillable text boxes show up but not the labels with them even though I have names entered in on Name and Tooltip.

Any suggestions?

    Correct answer George_Johnson

    One thing you can do is set up a custom Format script for a text field that is:

    // Custom format script for text field

    if (!event.value) event.value = event.target.name;

    This will display the field name in the field when the field is blank. The problem with this approach is it precludes easily using any of the built-in formats that you may want to use (Number, ZIP code, etc.). You still can, but it requires more scripting.

    2 replies

    Participant
    August 6, 2021

    Thank you!! awesome

    Inspiring
    November 23, 2010

    So what should happen when the user enters text in the field? Should the field name still be visible somehow?

    CuwenAuthor
    Known Participant
    November 23, 2010

    No.  I want the label to disappear when the user starts typing in text.

    George_JohnsonCorrect answer
    Inspiring
    November 23, 2010

    One thing you can do is set up a custom Format script for a text field that is:

    // Custom format script for text field

    if (!event.value) event.value = event.target.name;

    This will display the field name in the field when the field is blank. The problem with this approach is it precludes easily using any of the built-in formats that you may want to use (Number, ZIP code, etc.). You still can, but it requires more scripting.