3 Replies Latest reply on May 29, 2013 6:03 AM by Matthew Oaks

    Dynamically change the field background colour depending on the value of the field

    Matthew Oaks

      Hopefully someone can help with my problem, I haven't dealt with Java Script before so please bare with me as I try and explain myself.  I've tried looking all over for the answer but am getting slightly lost in some answers so just wondered if anyone on the forum can assist.

       

      I am trying to create a filable PDF form for a risk assessment. The user inputs values in the severity and likelihood columns and a value is automatically generated in the risk rating column. So I've managed to get the risk rating number to calculate automatically by using the calculate option and selecting value is the product of 'Severity1,Likelihood1'.  Thats great, so now I want the risk rating field to change the background colour depending on the value as follows;

      1-5 = green

      6-10 = orange

      11-25 = red

       

      I haven't a clue if this can be done via Java Script or if it's not possible, I'm sure it will be but I need someone much cleverer than me to direct me on how to do it. I suppose it's the same concept as conditional formatting in Excel.

      Below is something like what I'm trying to achieve.

      Any help would be greatly appreciated

      Thanks

      Matt

       

      Severity
      Likelihood
      Risk rating
      122
      236
      3412