Show message when one number is larger than the other

  • puntotecnologico15
    Asked on June 5, 2015 at 5:59 AM

    Hi, I would like have a alert message when the numeric value in one field is bigger that the value in other field.

    If  this  conditions is true it should be shown an alert message.

    Please tell me the instruction.

    Thanks 

    Nino
    vlepore75@gmail.com

  • Boris
    Replied on June 5, 2015 at 10:31 AM

    Hello Nino.

    We do not have a way to show "alert message", but you can show and hide regular Text fields when one number is bigger than another. You can achieve this by using Conditional Logic to Show/Hide a form field based on a value in another field.

    I have created a small demo of the feature here:

    http://form.jotformpro.com/form/51554555634964 (You can clone it to take a closer look.)

    Basically, we use two fields for the numbers, number 1 and number 2. These would be the fields that you probably already have on your form, which you would like to compare.

    You also need a regular Text field that will hold the message which you would like to present when the conditions are met.

    Show message when one number is larger than the other Image 1 Screenshot 60

    Then, we add a Form Calculation widget to your form, and set it up to calculate the difference between Number 2 and Number 1.

    Show message when one number is larger than the other Image 2 Screenshot 71

    Show message when one number is larger than the other Image 3 Screenshot 82

    You can make this Calculation field hidden, so that it is not shown on the form.

    Show message when one number is larger than the other Image 4 Screenshot 93

    Then, we create a condition, by going to Setup & Embed > Conditions > Show/Hide a form field, and select in that conditions that the message (Text field) is hidden, unless the Number 2 is bigger than Number 1.

    We do this by seemingly complex setting of rules, that:

    If Calculation is Less than zero (0), is Equal to zero, or if it is Empty, we hide the message (Text field). You can add these multiple rules by using the Add New Rule button, marked with 3 in the image.

    Show message when one number is larger than the other Image 5 Screenshot 104

    That is it. Please test the demo form linked above, and let us know if you need further guidance with this. We will be happy to help.