Can Jotform do some calculation based on birth date?

  • wahchan
    Asked on November 2, 2017 at 12:02 AM

    Can Jotform do some calculation based on birth date (as attached image) and output a preset result image from the calculation?

    Jotform Thread 1288313 Screenshot
  • Nik_C
    Replied on November 2, 2017 at 4:54 AM

    I was able to make your calculation work, here is how:

    1) I added eight number fields for day, month, and year:

    1509611532Screen Shot 2017 11 02 at 9 Screenshot 10

    2) Then I sum each of them into one number:

    1509611974Screen Shot 2017 11 02 at 9 Screenshot 21

    3) Below calculation, I added two number fields Number1 and Number2 which will extract the numbers from the calculation, in your example calculation is 30 so we need those number fields to be 3 and 0:

    -For number1 this is the calculation that will extract that number:

    1509612162Screen Shot 2017 11 02 at 9 Screenshot 32

    -For number2 this is the calculation that will extract that number:

    1509612224Screen Shot 2017 11 02 at 9 Screenshot 43

    4) Finally, we sum those two into one: 

    1509612275Screen Shot 2017 11 02 at 9 Screenshot 54

    But now there is another check that we need to perform, what if the code is a two number value i.e. 11, we need to extract that again, so further checking is implemented:

    1509612362Screen Shot 2017 11 02 at 9 Screenshot 651509612391Screen Shot 2017 11 02 at 9 Screenshot 76

    I added two more fields as you can see "Secret code Number check 1" and "Secret code Number check 2".

    Finally, we sum those two: 

    1509612470Screen Shot 2017 11 02 at 9 Screenshot 87

    You notice that we have two Secret code fields, so a condition that will say, if the second secret code is filled, hide the first secret code field, will solve that problem:

    1509612746Screen Shot 2017 11 02 at 9 Screenshot 98

    Note: All fields except the first Secret code field can be hidden, second Secret code field will show automatically if calculation reveals it.

    Further, you can use conditional logic to show images or whatever you need based on that field: https://www.jotform.com/help/57-Smart-Forms-Using-Conditional-Logic

    Feel free to check my form as well: https://form.jotform.com/73052449751963

    Let us know if you have any further questions.

    Thank you!

  • wahchan
    Replied on November 2, 2017 at 5:19 AM

    Wow! Thanks for your suggested solution but your sample form seems not working.

  • Nik_C
    Replied on November 2, 2017 at 5:24 AM

    Could you please share the test case that didn't work for you? Since I'm not able to find one that gives wrong calculation.

    Maybe there is a test case that I didn't cover, but the calculation is, so far, working as intended.

  • wahchan
    Replied on November 2, 2017 at 6:01 AM

    I am using your sample form at https://form.jotform.com/73052449751963 by enter 19/12/1978.

    The final answer should be 1+9+1+2+1+9+7+8 = 3+8 = 1+1 = 2. But the answer from your from is 1.

    Please check. Thanks.

  • Nik_C
    Replied on November 2, 2017 at 6:12 AM

    Thank you for additional inputs.

    I tested but I wasn't able to replicate this issue, I used the same numbers:

    1509617479screencast Screenshot 10

    I revealed the calculation field so it's easier to test.