- BenflipsAsked on July 20, 2016 at 08:59 PMSomeone gave me this similar workaround a while ago, and I have just played with the cloned form I made, but it doesn't seem to give an accurate result - example, I put in my date of birth 1 Aug 1978 and it said I was 39.
Now, I WILL be 39 this year, but I am not right now...can the code be tweaked to take account of the days that have elapsed compared with your actual birthday to make sure the result is 100% accurate?
- JotForm SupportjonathanAnswered on July 20, 2016 at 10:53 PM
You must be referring to the Calculate Age template form
I think the Dates Difference widget has the more accurate calculation.
I will check how it can be applied on the age calculation form also. I'll get back to this as soon as I have update.
- JotForm SupportjonathanAnswered on July 20, 2016 at 10:57 PM
I also found a solution that work on another user about the same scenario.
You can review the thread here.
- JotForm SupportjonathanAnswered on July 20, 2016 at 11:12 PM
Please test this form https://form.jotform.com/62018374848967
You can also clone the form so you can review it on your Form Builder.
Let us know if you need further assistance.
- BenflipsAnswered on July 21, 2016 at 06:20 PM
How do I clone again?
I have tested, this does work great.
Can you just tell me how to insert this into my existing form, using the existing DOB field I have currently on that form - I assume it's a number of hidden fields and calculation rules like earlier suggestions?
- JotForm SupportjonathanAnswered on July 21, 2016 at 06:43 PM
Please refer to our user guide on how to clone a form.
User guide: How-to-clone-an-existing-form-from-a-URL
This is my test form URL https://form.jotform.com/62018374848967
I suggest you clone the form so that you can better review it on your Form Builder. And you will be able to see also the hidden fields and calculation formula once you have the cloned form.
Below are also the steps I did to create the form.
The "Your Age" calculation have this formula: (you can see it also on the form once you cloned it)
As you can see I used the floor() function and divide the number of Days by 365.25.
Just add the necessary fields on your form and use the same formula for the Calculation fields.
Let us know how we can be of further assistance.
- BenflipsAnswered on July 21, 2016 at 09:45 PMSpectacular. It worked! Thanks.Now, can I have some help reducing the Age input (434) to the width of its
label, and hopefully still having height and weight on the same line.
Also, can you give me code to change the input field's appearance to look
'greyed out' or some other appearance to differentiate it from an active
field requiring an input. I have set the field to read-only, but that
hasn't changed the field's appearance
*Dr. Ben Phillips*
- JotForm SupportjonathanAnswered on July 21, 2016 at 10:58 PM
I created a separate thread for the next question here https://www.jotform.com/answers/888322
We will attend to it shortly.
- JotForm SupportWelvinAnswered on May 17, 2017 at 08:54 AM
@OBrandman: I have created a new thread for your inquiry. Link here https://www.jotform.com/answers/1146960.