Copy link to clipboard
Copied
Hi All
I'm trying to make a form that changes color based on input from a field. For example, if my "B" field is 100 then my "actual" field will display the text in red if the number input is in the range of (100*0.95 to 100*0.96)
Here is my attempt but it doesn't seem to work. Any pointers will be awesome thx
var lowrange = this.getField("B").value * 0.95;
var highrange = this.getField("B").value * 0.96;
var actual = event.value;
if (actual>=lowrange && actual<=highrange)
event.target.textColor = [ "RGB", 1, 0, 0];
else
event.target.textColor = [ "G",0];
Works fine for me, too.
Copy link to clipboard
Copied
The code looks fine, but where did you place it, exactly?
Copy link to clipboard
Copied
I tried to place them both in custom calc and in custom validation script and neither works. It's weird because it works if I just do (actual>=lowrange) but if I add in another range it stopped working. Been playing around with it for a few hours but can't figure out what's wrong
Copy link to clipboard
Copied
Does this field have a calculated value, or one entered by the user? Are there any error messages in the JS Console when you use it? Can you share the file with us?
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Works fine for me. Do you use any other software to open the file? How do you enter a number in 'Actual' field?
Copy link to clipboard
Copied
Works fine for me, too.
Copy link to clipboard
Copied
I'm using adobe acrobat pro. The number in the "actual" field is entered manually
Copy link to clipboard
Copied
It worked. All I had to do was restart my computer -__-