- neorankingAsked 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:
- CarinaAnswered 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:
Let us know if we can assist you further.
- neorankingAnswered on May 27, 2016 at 07:59 AM
Hi thanks for the solution!!
- JotForm UI DeveloperberilAnswered on May 27, 2016 at 08:35 AM
On behalf of my colleague, you're most welcome. Feel free to contact us anytime.
- neorankingAnswered on June 13, 2016 at 12:19 AM
Is it possible to have the "CONTRACT PERIOD:" field value to months?
If I enter 13/6/16 to 13/9/16. It should calculate as 3 months for the contract period.
- JotForm UI DeveloperberilAnswered 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.
- neorankingAnswered 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"?
- JotForm UI DeveloperberilAnswered 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.
- neorankingAnswered on June 13, 2016 at 07:07 AM
- JotForm UI DeveloperberilAnswered on June 13, 2016 at 09:39 AM
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:
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:
Feel free to clone it. We would appreciate it if you could also test it on your side and let us know the result.
- neorankingAnswered 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.
- JotForm SupportjonathanAnswered on June 14, 2016 at 12:39 AM
Please don't hesitate to contact us again anytime should you require further assistance.
- neorankingAnswered on June 14, 2016 at 04:38 AM
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.
- neorankingAnswered on June 14, 2016 at 04:39 AM
PeriodMonths is also not working properly.
- JotForm SupportliyamAnswered on June 14, 2016 at 07:06 AM
Please let us know if the problem persists after the change.
- neorankingAnswered on June 14, 2016 at 08:05 AM
I tried, but its still not working Liyam.
- JotForm SupportjonathanAnswered 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.
- neorankingAnswered 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.
- JotForm SupportliyamAnswered on June 14, 2016 at 12:00 PM
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.
- neorankingAnswered on June 14, 2016 at 10:45 PM
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.
- JotForm SupportChriistianAnswered 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
- neorankingAnswered 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?
- JotForm UI DeveloperberilAnswered on June 15, 2016 at 03:28 AM
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.
- neorankingAnswered on June 15, 2016 at 10:22 PM
Aweseome, thanks Beril!! :)