Copy link to clipboard
Copied
Hello i need Help please.
Iam searching for a Script to change the Text-Colour to red if i type the Number "5" in a certain Textfield in Acrobat (i am not used to JavaScript so i dont know much about it). There are lots of Texfields and i need the Script for all of them (not only for one specific Field).
I dont know what to do, tried a lot of different scripts but none of them worked yet. Would be great if someone could solve my Problem. Thank you!!
Place this script as a "Document level Javascript" :
function check5() {
if (event.value == 5) {event.target.textColor = color.red;}
else {event.target.textColor = color.black;}
}
Then you just have to call this function from each field, using this script as a "Validation script":
check5();
Copy link to clipboard
Copied
Place this script as a "Document level Javascript" :
function check5() {
if (event.value == 5) {event.target.textColor = color.red;}
else {event.target.textColor = color.black;}
}
Then you just have to call this function from each field, using this script as a "Validation script":
check5();
Copy link to clipboard
Copied
Perfect – thank you! It works and this helpes a lot.