How to require field only when necessary?

  • Ringle
    Asked on March 29, 2023 at 1:02 PM
    Unfortunately, in having some of our users "test" the form, we've run into
    another problem.
    The "description" field is a required one, so that is indicated on the form
    (*) for each of the 8 items. According to one user, they were testing the
    ability to order just 1 item. However, it kept throwing an error message
    until they put at least 1 character in the description field for each of
    the 8 items. That won't work. Generally, most of our users will only be
    ordering 1 or 2 items, so they certainly don't want to needlessly be
    putting characters in the remaining item description fields, when that
    action is of no value.
    Suggestions?
    Thanks
  • Shirized JotForm Support
    Replied on March 29, 2023 at 2:25 PM

    Hi Robert,

    Thanks for reaching out to Jotform Support. If you want your Description Field to be required when necessary, this can be achieved using the Enable/Require Field conditions. This way when your users select one of your items, the description field will only then be required. Let me show you how:

    • In the Form Builder, on the orange navigation bar, click on Settings.
    • On the left panel, select Conditions.
    • Click the Add a new condition button, then select  Enable/Require Field.

    1680113846 642480b615293  Screenshot 10

    You can follow the Conditions below: (This condition is for your Item 2)

    Follow the same condition for your other Items, only change the IF Statement for different Items.

    1680113301 64247e95ef1ff  Screenshot 21

    This means that when the QTY 2 is filled, the Description Field will be set as required. But, please make sure to disable all your Required fields in your Form Settings since this will be required conditionally.

    1680113569 64247fa1e6d48  Screenshot 32

    Here's the result:

    1680114220 6424822c36d04  Screenshot 43

    You can check out my demo form to see its settings and output.

    Give it a try and let us know how it goes.