How can I restrict numeric input across multiple fields?

  • Profile Image
    XtremeIce
    Asked on February 04, 2018 at 05: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

  • Profile Image
    Kiran
    Answered on February 04, 2018 at 08: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.png

    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.png

    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.png

    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.