Trying to change color of text when a certain amount is entered in Adobe Acrobat DC

New Here ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

Hello, 

I am creating a form where I have text fields that I want the text color to change when the number entered is > 9, = 10 or more and <20. I have tried other scripts shown in the help forum but those didn't work see below

if(event.value <= 9){
event.target.textColor = color.black;}
else if (event.value == 10){
event.target.textColor = color.yellow;}
else if(event.value >= 11){
event.target.textColor = color.red;}

TOPICS
General troubleshooting, JavaScript, PDF forms

Views

49

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jan 28, 2021 Jan 28, 2021
Use it as validation script.

Likes

translate

Translate

Translate
Adobe Community Professional ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

Where does you use the script?

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

I tried it in the custom calculation script and in the document javascript neither worked. 

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

Use it as validation script.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

That worked thank you so much for your help!!

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Most Valuable Participant ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

Your script doesn't cover all numbers between 9 and 10, and 10 and 11...

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines