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 autofill "CONTRACT PERIOD" field?

    Asked by neoranking on May 27, 2016 at 05:51 AM

    How to auto filled the "Contact Period" field by the values entered from "Start Date" and "End Date"? like this format ->

    "Start Date - End Date" or "Start Date" to "End Date".

     

    I'm trying to do it with Conditional Logic but the values are not displaying in Contract Period Field.

    I hope you can help me thanks! (please see screenshot)

    Page URL:
    http://www.ashtree.com.sg/airportpass/

    Screenshot
    contract how filled format thanks start date and
  • Profile Image

    Answered by Carina on May 27, 2016 at 06:26 AM

    1. Add 2 Date Time fields:

    2. Please add 2 form calculation fields, one for each date field. Add the correspondent date field to the calculation formula.

    Double click on the red square area to activate the text option:

    Repeat this process for both date fields.

    3. Add a 3rd form calculation. To the formula add the start date calculation, add the text "to" , add the end date calculation field:

     

    You can test and clone the demo form:

    https://form.jotform.com/61472782620961 

    Let us know if we can assist you further.   

  • Profile Image

    Answered by neoranking on May 27, 2016 at 07:59 AM

    Hi thanks for the solution!!

  • Profile Image
    JotForm Support

    Answered by beril on May 27, 2016 at 08:35 AM

    On behalf of my colleague, you're most welcome. Feel free to contact us anytime.

  • Profile Image

    Answered by neoranking on June 13, 2016 at 12:19 AM

    Hi,

    Is it possible to have the "CONTRACT PERIOD:" field value to months?

    For example:
    If I enter 13/6/16 to 13/9/16. It should calculate as 3 months for the contract period.

  • Profile Image
    JotForm Support

    Answered by beril on June 13, 2016 at 02:55 AM

    Yes, it is possible to calculate the number of dates between two days. All you need to do is subtracting two dates with your calculation field as you see below:

     

    Here is how it works:

     

    If you have any question or issues, please do not hesitate contacting us. We will be glad to assist you.

  • Profile Image

    Answered by neoranking on June 13, 2016 at 04:57 AM

    Thanks for that wonderful solution. Is it possible to say like "2 Months" or "2 Days" or "2 Years"?

  • Profile Image
    JotForm Support

    Answered by beril on June 13, 2016 at 06:18 AM

    You're most welcome.=) Yes it should be possible with JotForm. To do that, we need to add different calculation field on your form. I will try to find how to do it on your cloned form. After that, I will get back to you soon with a solution as soon as possible.

  • Profile Image

    Answered by neoranking on June 13, 2016 at 07:07 AM

    Thanks Beril!

  • Profile Image
    JotForm Support

    Answered by beril on June 13, 2016 at 09:39 AM

    Hi again,

    Finally, I am able to manage your problem.=) First of all, I've added the calculation field as you see below:

    By that way, we will calculate days, months and years. After that, I've added three calculation fields on your form as you see below:

    I've calculated the days, months and years value ass you see below: 

    Days value:

    Months value:

    Years value:

    Now, we will hide month and year if the calculation is less than 1. We will hide day and year if the calculation is less than 12 and greater than 1. And finally, we will hide month and day if the calculation is greater than 12.

    However, I am not able to hide days and I am not sure why it is happening. 

    Here is how it works:

    I will try to solve that issue. If I solve that I will update you via that thread. Kindly, also check your demo form. Here is your cloned form:

    https://form.jotform.com/61640913986969

    Feel free to clone it. We would appreciate it if you could also test it on your side and let us know the result.

  • Profile Image

    Answered by neoranking on June 14, 2016 at 12:31 AM

    Thanks, I will try this on my form. PLease let me know if you resolve the "Days" Issue.

    Many thanks!

  • Profile Image
    JotForm Support

    Answered by jonathan on June 14, 2016 at 12:39 AM

    Please don't hesitate to contact us again anytime should you require further assistance.

    Thank you.

  • Profile Image

    Answered by neoranking on June 14, 2016 at 04:38 AM

    Hi,

    I tried to clone the form, but as you can see here - http://www.ashtree.com.sg/airportpass/ the PeriodDays, PeriodMonths and PeriodYears are showing.

  • Profile Image

    Answered by neoranking on June 14, 2016 at 04:39 AM

    PeriodMonths is also not working properly.

  • Profile Image
    JotForm Support

    Answered by liyam on June 14, 2016 at 07:06 AM

    Hello neoranking,

    Can you try embedding the form using iframe embed code instead of javascript? It appears that it's conflicting with the other form and other scripts on your page.

    Please let us know if the problem persists after the change.

    Thanks.

  • Profile Image

    Answered by neoranking on June 14, 2016 at 08:05 AM

    I tried, but its still not working Liyam.


    http://www.ashtree.com.sg/airportpass/

  • Profile Image
    JotForm Support

    Answered by jonathan on June 14, 2016 at 09:31 AM

    Can you also take a screenshot of the problem? You can share to us a visual of the issue so we can understand more about it. You can upload the screenshot image when you respond using this link https://www.jotform.com/answers/848415

    --

    I test it on your website http://www.ashtree.com.sg/airportpass/  but I could not replicate the issue so far. See the video below of my test.

     

     

    We will wait for your updated response.

     

     

  • Profile Image

    Answered by neoranking on June 14, 2016 at 09:52 AM

    Please see attached image. As you can see I have put a date June 16, 2016 as Start Date and July 16, 2016 as End Date. As a result it should give me a "Contract Period" of 1 Month right? Also, all calculations must be hidden and will be displayed upon inputting start date & end date.

    Thanks a lot.

  • Profile Image
    JotForm Support

    Answered by liyam on June 14, 2016 at 12:00 PM

    Hello,

    Can you try clearing your browser's cache? So far this is how it works on my view on your webpage:

    If the problem persists after clearing your browser's cache, please do let us know.

    Thanks.

  • Profile Image

    Answered by neoranking on June 14, 2016 at 10:45 PM

    Hi Liyam,

    There's no problem with days. Try month like June 21, 2016 - July 21, 2016. You will see the issue. It should show 1 month but its not working.

    Best regards.

  • Profile Image
    JotForm Support

    Answered by Chriistian on June 15, 2016 at 01:32 AM

    I checked the conditions in your form and it seems that the issue is caused due to the value 1 not being included in the condition. Since the condition is set to "greater than 1" but the exact month is only equal to 1, the proper calculation in the condition is not being applied. To resolve the issue, please replace the greater than "1" conditions into greater than "0.99".

    Once you have replaced all the conditions with the value 1 into 0.99, the condition should now work correctly. Here's a demo form so you can see it in action: https://form.jotform.com/61660509575966 

  • Profile Image

    Answered by neoranking on June 15, 2016 at 01:51 AM

    It's working now thanks for that Chriistian! Can you see what's the problem why the "CONTRACT PERIODdays" is not hiding while other are working properly?

  • Profile Image
    JotForm Support

    Answered by beril on June 15, 2016 at 03:28 AM

    Hello,

    Finally, I found the issue.=) It seems there is an old condition which causes that problem. If we disable that it is working properly.

    Please also test it on your side and let us know the result. If you notice any issue, please do let us know. We will be happy to help you.

  • Profile Image

    Answered by neoranking on June 15, 2016 at 10:22 PM

    Aweseome, thanks Beril!! :)