Can Jotform do some calculation based on birth date?

  • Profile Image
    wahchan
    Asked on November 02, 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?

  • Profile Image
    Nik_C
    Answered on November 02, 2017 at 04: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.35

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

    1509611974Screen Shot 2017-11-02 at 9.43

    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.44

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

    1509612224Screen Shot 2017-11-02 at 9.47

    4) Finally, we sum those two into one: 

    1509612275Screen Shot 2017-11-02 at 9.48

    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.491509612391Screen Shot 2017-11-02 at 9.50

    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.51

    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.53

    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!

  • Profile Image
    wahchan
    Answered on November 02, 2017 at 05:19 AM

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

  • Profile Image
    Nik_C
    Answered on November 02, 2017 at 05: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.

  • Profile Image
    wahchan
    Answered on November 02, 2017 at 06: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.

  • Profile Image
    Nik_C
    Answered on November 02, 2017 at 06:12 AM

    Thank you for additional inputs.

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

    1509617479screencast.gif

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