Copy link to clipboard
Copied
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';
}
You will need to use the On Focus event for this. Here's an example:
event.target.textColor = color.black;
PS. In the future you should post under the Acrobat forum if you have questions about creating form fields and using scripts. The Reader forum is about viewing PDF files in Reader.
Copy link to clipboard
Copied
You will need to use the On Focus event for this. Here's an example:
event.target.textColor = color.black;
PS. In the future you should post under the Acrobat forum if you have questions about creating form fields and using scripts. The Reader forum is about viewing PDF files in Reader.
Copy link to clipboard
Copied
Excellent, thank you!