What if I want to calculate mileage for employees? I want to be able to put in a starting mileage and an ending mileage and have the form calculate t

  • Profile Image
    Asked on June 26, 2012 at 09:31 AM
  • Profile Image
    Answered on June 26, 2012 at 08:38 PM


    Embed your form using full source code and then add this javascript to calculate the two mileage fields.

    <script type="text/javascript">

    function addmiles(){

    var first = document.getElementById('first_5').value;

    var last = document.getElementById('last_5').value;

    var total = eval(first) + eval(last);

    document.getElementById('input_6').value = total;



    Demo: http://idarktech.com/demo_calculate.html

    Let me know if you need further clarification. Thanks!