Skip to main content
Participant
March 9, 2020
Answered

Instructional Text in Adobe Form Grey Please

  • March 9, 2020
  • 2 replies
  • 1405 views

Hi there,

Just wondering if someone could help out with a bit of Java script please I have the following code within a text field and works ok and disappears when you start typing in that field but looking at the text is there a way to make the text light grey instead of black?

 

Tried the second option from Gilad D and didn't work for me

https://answers.acrobatusers.com/Is-add-instructional-text-text-field-disappear-clicked-q195078.aspx

 

Thanks ..... aussie

 

if (!event.value) {

event.value = "DD/MM/YYYY";

event.target.display = display.noPrint;

} else {

event.target.display = display.visible;
}

    This topic has been closed for replies.
    Correct answer JR Boulay

    If you want to change the font color reliably, you should use the second script provided on this page, but be sure to enter a "default value" in "Properties : Options" for each field.

     

    // On Focus script:
    if (event.target.value==event.target.defaultValue) {
        event.target.value = "";
        event.target.textColor = color.black;
    }
    
    // On Blur script:
    if (event.target.value=="") {
        event.target.value = event.target.defaultValue;
        event.target.textColor = color.ltGray;
    }

     

    2 replies

    try67
    Community Expert
    Community Expert
    March 10, 2020

    That's not the code I provided. My reply contains the code posted by JR_Boulay in this thread.

    The code you used was written by George Johnson.

    Participant
    March 10, 2020

    Thanks team, finally worked it out. Appreciate your assistance. I'll be honest I'm a bit new to this so with what you said here " enter a "default value" in "Properties : Options" for each field. " did the trick

     

     

    JR Boulay
    Community Expert
    JR BoulayCommunity ExpertCorrect answer
    Community Expert
    March 10, 2020

    If you want to change the font color reliably, you should use the second script provided on this page, but be sure to enter a "default value" in "Properties : Options" for each field.

     

    // On Focus script:
    if (event.target.value==event.target.defaultValue) {
        event.target.value = "";
        event.target.textColor = color.black;
    }
    
    // On Blur script:
    if (event.target.value=="") {
        event.target.value = event.target.defaultValue;
        event.target.textColor = color.ltGray;
    }

     

    Acrobate du PDF, InDesigner et Photoshopographe