Inventory Widget: How to limit quantity choices to specific values?

  • LowerTrent
    Asked on October 14, 2016 at 11:49 AM

    I would like to limit the quantities a user can select to multiples of 10

     

    formID=62804483345256

  • LowerTrent
    Replied on October 14, 2016 at 11:53 AM

    i was thinking I could use some conditional logic to make sure the the quantity selected ends with a 0, but there is no suitable condition type to alert the user that the quantity must be a multiple of 10.

  • Kevin Support Team Lead
    Replied on October 14, 2016 at 1:25 PM

    I think you will achieve this by using another widget called Form Calculation, this will help you to take and evaluate the quantity entered in the Inventory Widget, this way you will now if it ends in 0 or not. 

    Here are the steps, first add the widget to your form: 

    Inventory Widget: How to limit quantity choices to specific values?  Image 1 Screenshot 70

    In the widget add this formula:

    Inventory Widget: How to limit quantity choices to specific values?  Image 2 Screenshot 81

    You will also need to add a text field where you will display the message if the quantity entered is not correct:  

    Inventory Widget: How to limit quantity choices to specific values?  Image 3 Screenshot 92

    Now if the number entered in the widget is not multiple of 10 the result of the calculation will be a decimal value, here you can set up a condition to show the alert message if this is the case, here is a screenshot of the condition that I have added to my form: 

    Inventory Widget: How to limit quantity choices to specific values?  Image 4 Screenshot 103

    On this guide you will also find more details about conditions: Smart-Forms-Using-Conditional-Logic

    Here is the result: 

    Inventory Widget: How to limit quantity choices to specific values?  Image 5 Screenshot 114

    You may also set the calculation as hidden so it does not show in the form: 

    Inventory Widget: How to limit quantity choices to specific values?  Image 6 Screenshot 125

    Here is the link to my form where you can test how it works: https://www.jotformpro.com/form/62874917597981 

    Please do note that this has been applied only to the first widget in your form, but the steps for the other widgets are the same.

    However, if you have any question do not hesitate to let us know, we will be glad to assist you. 

  • LowerTrent
    Replied on October 14, 2016 at 3:02 PM

    thank you so much for this excellent detailed response. i will give it a try!