Prevent users from submitting the form when both fields data are not the same

  • couragerenewal
    Asked on June 9, 2014 at 5:12 PM

    I would like to ask the following type of question.

    1. HOW MANY FRUITS DID YOU EAT TODAY? [_X_]

    2. HOW MANY OF EACH FRUIT?
    Apples [_a_]
    Bananas [_b_]
    Oranges [_c_]
    Watermelon [_d_]

    And I want it so that they cannot submit the form unless (a + b + c + d = X)

    With the calculation and conditions tools available, is this possible?

     

    PS. The form I'm trying to do this for is here, and it's the final prompt about identifying primary professions.

  • Welvin Support Team Lead
    Replied on June 9, 2014 at 7:03 PM

    Hi,

    We will look into this one and get back to if we find the possible way. I've tried using math functions, but no luck so far.

    Thanks

  • jonathan
    Replied on June 9, 2014 at 7:19 PM

    @ couragerenewal

    Hi,

    It is actually possible using Calculation and Condition.

    Please test this form http://www.jotform.me/form/41597190072456

    In my demo form, you have to make sure that the total of All individual fruits should match the "fruits eaten"

    Example:

    Prevent users from submitting the form when both fields data are not the same Image 1 Screenshot 20

    Hope this help. Inform us if you need further assistance.

    Thanks!

  • jonathan
    Replied on June 9, 2014 at 7:34 PM

    Btw, I should have shared also the calculation and condition I did. So, here it was

    Calculation:

    I calculated the total of each individual fruits and then substract it to "fruits eaten"

    Prevent users from submitting the form when both fields data are not the same Image 1 Screenshot 30

     

    Conditions:

    If the Calculation is equal to zero(0), that is.. "fruits eaten" - "each fruit" = 0   then I show the Submit button

    Prevent users from submitting the form when both fields data are not the same Image 2 Screenshot 41

     

     

    Thanks!

  • couragerenewal
    Replied on June 9, 2014 at 7:49 PM

    Beautiful! Incredibly helpful response. I just replicated these calculations and conditions on my form and it works like a charm. Thank you.