1 Reply Latest reply on Dec 9, 2008 7:58 AM by gkaiseril

    Javascript calculation

    neil451 Level 1
      Hi everyone

      Can someone please tell me how I can get a calculation to work using javascript. I have a number field created in LiveCycle into which I want the end users to type in their mileage.

      In a number field below, I want it to calculate the cost based on a mileage rate, of say 0.25 per mile. and display it as a cost figure, ie £250.00.

      Any help would be appreciated.

      Many thanks

      Neil
        • 1. Re: Javascript calculation
          gkaiseril MVP & Adobe Community Professional
          Not much information to work with.

          LiveCycle Designer uses 2 Scripting languages, FormCalc and JavaScript, and both are documented in the 'Scripting Reference' under the 'Help' menu item in LiveCycle Designer. The mulitiplicative operator is '*' for both languages. For the form field you will need to specify the display format to get the pounds symbol.

          FormCalc:

          Mileage * 0.25

          JavaScirpt:

          $.rawValue = Milage.rawValue * 0.25;