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

Is there a way to format instructional text to my text field that disappears when clicked?

Community Beginner ,
Jan 11, 2018 Jan 11, 2018

Copy link to clipboard

Copied

I have the prompt text figured out using this script taken from this forum: Is there a way to add instructional text to my text field that will disappear when clicked? (PDF For...

// 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;

}

Is their a way to change the prompt text's size and make it different from the type size I have set for them to fill out in the form. I want the type size of the prompt to be smaller than what size they use to fill it out.

TOPICS
PDF forms

Views

15.7K

Translate

Translate

Report

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 , Jan 11, 2018 Jan 11, 2018

Why yes there is, and your code is already setup for adding it.  The "display" is a property of the text field object, and it is being set one way for the help text, and another way when the user enters the text. The text size is also a property of the text field object and it can be set in the same way.

// Custom Format script for text field

if (!event.value) {

event.value = "Instructional text goes here";

event.target.display = display.noPrint;

event.target.textSize = 12;

} else {

event.target.displ

...

Votes

Translate

Translate
Community Expert ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

I don't know.

Votes

Translate

Translate

Report

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 ,
Sep 09, 2020 Sep 09, 2020

Copy link to clipboard

Copied

Yes, it can be done. You would need to write a script to iterate over all the fields in the file (using numFields and getNthFieldName), check which ones are text fields (using getField and the type property) and then apply the code to them as the Format script (using the setAction method).

Votes

Translate

Translate

Report

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