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

    How to calculate the difference between two dates and a fee based on those dates

    Asked by DownwardDogATX on May 04, 2016 at 02:10 PM

    I am trying to create a form for my dog sitting business where the user can input the dates and it will automatically calculate their total and let them pay through PayPal. Is there a way to do that? I've been playing with it for a while and I can't seem to figure it out :/

    create a form create and let
  • Profile Image
    JotForm Support

    Answered by david on May 04, 2016 at 03:27 PM

    You can achieve your requirement with using our Form Calculation widget.

    First you need to add 2 date fields to your form. Then add Form Calculation widget and configure it to calculate the number between two dates. 

     

     

    If you want to calculate the difference between today and the other date field you can set first date field’s value to default and hide it. This will set date field value to today and it will never be seen on your form. 

     

     

    You can find additional information about Form Calculation widget here.

    Once you have the number of days calculated, you can add another calculation widget to calculate the total fee or you can include the fee calculation in your original calculation.  When you have your total, you can pass that total to PayPal for payment processing:

    https://www.jotform.com/help/275-How-to-pass-a-calculation-to-a-payment-field