2 Replies Latest reply on Jan 3, 2013 9:46 AM by Erika_Romenesko

    How can two calculated text fields update each other?


      I am a newbie to javascripting. I created a worksheet that provides information based off of the user inputting their annual gross income into a text field (AnnInc). I then display the monthly gross income (MonInc) through a custom calc script. (I know I could have used a simplified field notation to accomplish the same thing.)


      // Get first field value
      var v1 = getField("AnnInc").value;

      // Calculate
      event.value = v1 / 12;


      I have a request to allow users to input either Annual or Monthly income to drive the rest of the worksheet calcs. I know there's got to be an easy way to do this but am at a loss. How can I make these two fields update each other accordingly? So if the user chooses to put in monthly or annual those two fields update each other?


      Thank you!