10 Replies Latest reply on Jul 9, 2015 12:20 PM by George_Johnson

    JavaScript to Execute Form Field Action - Change Fill Color Based on Condition


      Hi Everyone,


      I apologize if this question has been asked already - but I've been looking for the last couple hours and not finding what I need. I have a PDF form (created from an excel file) and need to change the fill color of a combo box form field, based on the selection made by the user from that form field.


      Specifics - I have multiple questions listed on the form. I've setup a combo box form field for each of the questions so that the user can select the following list of options:





      I see from the Properties menu of the form field that I can perform an action when their "mouse clicks up" as the trigger  (Run JavaScript option); but I don't know what script to enter for this to happen. This is where I need help


      So I need the script for when the user selects one of the listed options, the fill color will change depending on the selected answer:

      "YES" changes fill color to GREEN

      "NO" changes fill color to RED

      "UNSURE" changes fill color to YELLOW


      Please let me know if you need more details or a better explanation on what I'm needing. Thank you so much for anyone that can help!


      PS - I am complete amateur in any type of JavaScript or codes so I may need some explanation given or if this is not possible.