Skip to main content
Participant
Mar 9, 2020 11:53 PM UTC
Answered

Instructional Text in Adobe Form Grey Please

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 is closed to new replies. Start a new post to keep the conversation going.
    JR Boulay
    JR BoulayCorrect answer
    Community Expert
    Mar 10, 2020 9:01 AM UTC

    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

    3 replies

    try67
    Community Expert
    Community Expert
    Mar 10, 2020 11:19 AM UTC

    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.

    Translate
    Participant
    Mar 10, 2020 12:36 PM UTC

    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

     

     

    Translate
    JR Boulay
    Community Expert
    JR BoulayCommunity ExpertCorrect answer
    Community Expert
    Mar 10, 2020 9:01 AM UTC

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

     

    Translate
    Acrobate du PDF, InDesigner et Photoshopographe