4 Replies Latest reply on May 21, 2016 11:59 AM by Bran51

    My form colorfill javascript isnt working as I had hoped? Is it not possible?


      I have been looking at similar form fill color issues on the forums but my problem is just a little bit different.  My form fill only changes color when I have it selected.  I am trying to set up a javascript to change the color based on a certain value and to have that color view-able at all times as a way for a boss to quickly see if anything is red.


      I found another blog that suggested using a script and I tailored it to my needs below:

      I have it input in the actions based on a mouse exit, I have tried putting it in validation but it doesn't work completely when I do that.

      var f = this.getField("MX STATUS");


      if (f.value == "FMC")


          f.fillColor = color.green;  



      if (f.value == "PMC")


          f.fillColor = color.yellow;  



      if (f.value == "NMC")


          f.fillColor = color.red;  




      This only kind of works, as I stated above, when I input the value the form will change but as soon as I leave and enter another form area it will go back being blue.  I think I will need a way to have it go back to blue if an entry is erased as well. 

      I am also worried that I will need some way to only accept these three entries and nothing else.  Lastly I would idealy want a "overall MX status" field to change color based on a combination of values from all of the "MX Status".  I only have a basic understanding of C++ from an elective class I took in 2005.  I dont know if I am expecting too much from javascript or if I just dont know quite how to do it.  Thank you for looking into this!


      I am using Adobe Acrobat XI ver: 11.0.13