Copy link to clipboard
Copied
After marking a text field as "Required", the red border should be automatically removed after entering a value or text. How can I do this in Adobe Acrobat Pro 2020? so that the form works in the free Acrobat Reader.
Copy link to clipboard
Copied
Red highlights are like blue backgrounds: they cannot be printed.
And they work the same in Acrobat Reader.
Copy link to clipboard
Copied
I'm not interested in printing, but in the user interface. The user should be able to see the red border on the screen and after entering something the red border should disappear and this should repeat as long as there is text or no text in the field. I probably need java script and step-by-step instructions for a beginner :-).
Copy link to clipboard
Copied
- Don't use the "required" option for the fields, or deactivate highlighting by placing this code as a Document Level script:
app.runtimeHighlight = false;
- Use the Appearance options to put a red stroke to the fields.
- Place this code as an "On Blur" action in the fields:
if (event.target.value === event.target.defaultValue) {event.target.strokeColor = color.red;}
else {event.target.strokeColor = color.transparent;}
Copy link to clipboard
Copied
Thanks for the information. I solved it with this code and it actually works great.
var fieldName = "Textfiled1.0";
function updateBorderColor() {
var field = this.getField(fieldName);
if (field.value !== "") {
field.borderColor = color.transparent;
} else {
field.borderColor = color.red;
}
}
this.getField(fieldName).setAction("Validate", "updateBorderColor();");
this.getField(fieldName).setAction("Keystroke", "updateBorderColor();");
this.getField(fieldName).setAction("Custom", "updateBorderColor();");
updateBorderColor();
Thx again.
Copy link to clipboard
Copied
Where do you use this script?
Copy link to clipboard
Copied
Why simplify when you can complicate?
🙂
Find more inspiration, events, and resources on the new Adobe Community
Explore Now