5 Replies Latest reply on Nov 16, 2017 5:27 AM by try67

    Java Script for calculation in DC

    amandas53942597 Level 1

      Hi,

       

      I have zero experience with Java script and only just figured out calculations in Livecycle before they shut down support & now our forms won't open - i've had to re-crate our forms in Adobe DC.

       

      I need to write a calculation, I have 3 number fields (Quantity, Price, Total)

       

      Item               Quantity                                                                 Price          Total

      Battery          less that 35 batteries                                               $25             $25

      Battery          more than 35 batteries, less than 69 batteries        $25             $50

      Battery          more than 70 batteries, less than 104                     $25              $75

       

      OR in other words, for every 5kg of batteries (which we worked out to be approx 35 batteries) ordered there is a $25 charge (per 5kg) added to the total. So if they order 35 batteries = 5kg = $25, if they order 40 batteries it would be $50 as we'd have to round up to 10kg.

       

      Does anyone know how I write this in Java Script to enter into 'simplified field notification' or 'custom calculation script'

       

      SO MUCH THANKS if anyone can help!

      Amanda

       

      edit: I'm using Adobe DC, i've got a form I made previously in livecycle that I'm converting the fields to fillable fields in Adobe DC.