Skip to main content
Inspiring
September 21, 2016
Answered

Javascript Text Color Change Not Working On IOS App

  • September 21, 2016
  • 1 reply
  • 523 views

Hello all,

Hoping to find some help regarding an issue I'm having. I have a  javascript running a calculation. If that calculation is off by a certain amount compared to another field it turns the text red. This is working flawlessly on pc and on microsoft tablet. However this is intended to be used on a IPad which it is not performing the task properly. The text changes red but then does not change back to black once the value is corrected. I have a ton of other scripts that are all working fine on IPad, it is just this color issue that is preventing me from finishing.

Here is the script I'm running to change the color:

if (Math.abs(this.getField("CALCULATED_WIDTH").value-this.getField("WIDTH").value)>=.03) {

    this.getField("CALCULATED_WIDTH").textColor = color.red;

}

else {

    this.getField("CALCULATED_WIDTH").textColor = color.black;

}

Hopefully someone can help me out with a solution.

Thanks

This topic has been closed for replies.
Correct answer George_Johnson

That code should work if you use Readdle's PDF Expert, but other PDF viewers such as Adobe Reader have far less support for JavaScript and some have none at all.

1 reply

George_JohnsonCorrect answer
Inspiring
September 21, 2016

That code should work if you use Readdle's PDF Expert, but other PDF viewers such as Adobe Reader have far less support for JavaScript and some have none at all.

smizyAuthor
Inspiring
September 22, 2016

Thanks again George, downloaded app and it works fine. To bad dit was $10