How can I restrict numeric input across multiple fields?

  • XtremeIce
    Asked on February 4, 2018 at 5:55 AM

    Hi

    I have guest booking form, where the user needs to input food quantities for guests. There are multiple choices of food quantities, but I need the total value across all choices to be the same value as the number of guests. For example, the user has a choice of party pies, sausage rolls etc. If they have selected that 10 guests are coming, I need to restrict the food choices across the multiple selections to be 10 and no more or less

    Is this possible to do?


    Thanks

    Andrew

    Jotform Thread 1372114 Screenshot
  • Kiran Support Team Lead
    Replied on February 4, 2018 at 8:15 AM

    I understand that you want to check the number of total guests and the total value of food choices to be the same. If so, you may consider adding a Form Calculation widget to the form to add the values from the food choice fields.

    1517749568Selection 050 Screenshot 10

    Now, you may have a text field to display an error message on the form if the total is not matching as shown below:

    1517749943Selection 051 Screenshot 21

    You may setup the condition as displayed below to show the message and hide the submit the button to avoid the user to submit the form.

    1517749959Selection 052 Screenshot 32

    Please see the cloned version of your JotForm with the above changes:

    https://form.jotform.com/80343032097955

    If you need any further assistance or referring to something different, please let us know. We will be happy to help.