1 Reply Latest reply on Apr 18, 2012 1:33 PM by George_Johnson

    Is there a way to calculate the value of a field once a value is selected from a drop down field?

    pmcdowell12

      Is there a way to calculate the value of a field once a value is selected from a drop down field?

       

      I have a drop down list with values.  Once a value is selected, I need to calculate a total which is a text field.  I've tried the mouse over, mouse under, mouse enter, onfocus, and onblur.  None of them is doing what I need.  Here is my code.

       

      var sessions = this.getField("num_of_sessions");

      console.println("new value = "+event.value);

      var total = this.getField("total_fee");

      console.println("sessions = "+sessions.value);

          if (sessions.value == "6") {

              total.value="300.00";

          }

          else if (sessions.value == "12")

          {

              total.value="550.00";

          }

      console.println("total = "+total.value);