Script – for two radio button and the result in last text field have to change the color according value of radio button and two fields

sorry but my script knowledge is verry poor. I know how to set the properties of field and text in forms, but im not so confident with scripts.

I have one PDF form, two radio button, OptionA and OptionB. OptionA have value 5, Option B value 10. The value are fixed.
Now, I have first field text, there value can be any from 0 to 100, were is manually insert. The second field text, also manually insert, can have any value from 0 to 1000.
The script have to change the color in second text field according two condition, in green or red.
Example: Radio button OptionA (is 5) selected, value in first text field, let say 16, value of second text field is, let say 210, the color have to be green, because 210 is bigger value then 5 multiply 16 = 90. But if value of second field are 87, the color of second field, actualy 87, have to be red because is bellow 90.
The idea is that when the value of second field is greater than multiply result of radio button and first text field, the color is green, when is less, then text red color.

EX. radio button OptionA, with value 5,
516=90 the value of second text field is 210 color of 210 is GREEN
5
16=90 the value of second text field is 79, the color of 78 is RED.

radio button OptionB, with value 10
10*16=160 the value of second field text is 205, the color of 205 is GREEN  205>160
10*16=160, the value of second field is 147, the color of 147 is RED because is smaller value than 160. 147<160

I appreciated a lot your effort, and I have to say thanks even for allocated time to read my needed help.

I complete the form, but I cant wright the script.

  • one of your first considerations in design is others abilities or disabilities, So as trainer I had to understand many designers are actually red/green colour blind and that causes problems for when red is for save rather than danger, so it is best not to use colours to indicate pass or fail. A secondary problem with PDF is there can be lagging of changed states so you need to add extra checks and flushing on activity and many users dont allow scripting to run in a PDF so would not see a change in colour even if not colour challenged. You need to write multiple solutions, to be acceptable PDF.

    – 

  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it’s currently written, it’s hard to tell exactly what you’re asking.

    – 
    Bot

Leave a Comment