Create a form that checks if the entered value is a multple of a specific number

  • Profile Image
    whatsyourvape
    Asked on January 17, 2018 at 11:47 AM

    Can I use conditions to require that a specific multiple be used for a quantity?

    In other words, Can I require that a person order a quantity that is a multiple of a certain value?

  • Profile Image
    Mike_G
    Answered on January 17, 2018 at 12:31 PM

    Using conditions, it is possible to create an equation and check if a number entered on a field is a multiple of a certain number/value.

    After that, you can have another condition to show/hide the submit button based on the result of the equation. You can also create a message using Text (HTML) field that will show if the conditions are not met.

    Here's a sample form — https://form.jotform.com/80164693496972

    Feel free to create a clone version of that form in your account so you can inspect it.

    You may also find the guides below helpful:

    How-to-Manipulate-Text-String-with-Conditions-and-Calculation

    How-to-Perform-Form-Calculation-Using-a-Widget

    Calculate-Values-in-the-Input-Table-Through-Condition

    How-to-Perform-Form-Calculation-in-the-Matrix-Field

    And if, in any case, I have misunderstood your concern, please feel free to let us know.

  • Profile Image
    whatsyourvape
    Answered on July 03, 2018 at 12:01 PM

    Hi, I have a combination of calculations and conditions to force ordering in multiples of 5. However, if the total entered, adds up to an even number, the order will still go through. Any ideas on how to close this loophole?

  • Profile Image
    Mike_G
    Answered on July 03, 2018 at 01:51 PM

    I have checked the form you are currently working on and noticed that you have added all the fields in the Pods (input) table into another field. Then, you have divided the total by 5 to conditionally check if it will have a decimal point in its quotient and hide the submit.

    I understand that it will create an issue if the total of all the fields in the Pods (input) table would be divisible by 5. (For example; 3pcs — 18mg Tobacco, 2pcs — 36mg Fruit, and 5pcs — 48mg Scorpio).

    To fix the issue, I suggest that you do the following:

    Step 1 —  update the condition below from:

    1530637579t13_05_29.png

    To:

    1530637637t13_06_41.png

    Step 2 — Delete the Pod Quantity Calculation

    1530637763t13_07_59.png

    Note: Only delete the field if there is no data associated with it.

    Step 3 — Remove all the "+" signs from the Pod Quantity Total

    1530638051t13_13.gif

    Step 4 — Enclose every tile that represents each cell (field) in the Pods (input) table in parenthesis. Make sure that each parenthesis is a "String" and not a "number" (click to change).

    1530638809t13_24_41.png

    Step 5 — Divide each cell (field) in the calculation by 5.

    1530639811t13_42_55.png

    Here's how it works.

    1530640150t13_46_01.png

    I hope this helps. If you have other questions or concerns, please do not hesitate to let us know.

  • Profile Image
    whatsyourvape
    Answered on July 03, 2018 at 02:37 PM

    Worked perfectly! Thank you so much!