What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.

  • Profile Image

    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

    Asked by eandmconstruction on June 26, 2012 at 09:31 AM
    Page URL:

  • Profile Image
    JotForm Support

    Answered by idarktech 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!