Skip to main content
Participant
April 11, 2024
解決済み

How can I get the font colour in a text box to change when I start typing?

  • April 11, 2024
  • 返信数 1.
  • 550 ビュー

So I have a text box that has a default value displayed and I have made the font grey, so that when it is printed, you can write over the top of the default value easily to fill it in by hand. Aside from being a printable form to be filled in by hand, I also want to be able to fill in the form electronically, however, when I type into the text box and the default value disappears (I have used a JavaScript format for that, see below) the text that is typed into the box is still grey, I want the text to turn black when I begin typing into the field. How can I do this? I'm thinking probably an addition to the JavaScript, but my grasp of it is very limited.

 

 

 

The JavaScript format I have used is:

 

 

 

if (event.value == "") {

        event.target.display = display.visible;

        event.value = 'DDMMYY';

    }

このトピックへの返信は締め切られました。
解決に役立った回答 Karl Heinz Kremer

This old question has information about how to do that: 

 

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

返信数 1

Karl Heinz  Kremer
Community Expert
Community Expert
April 11, 2024
Participant
April 12, 2024

Perfect, thank you!