We have an order form on our website that sometimes gets submitted with no product(s) selected. Is there a way to require at least one of the Product fields be completed without making ALL the Product fields required?
For example, if we sell Forks, Knives, and Spoons, how do we require the customer to choose at least one of these products? I can’t make all fields required because they may only want a fork. But they need to choose something.
By default there’s no way to require at least one field from a group of them.
But you can create your own custom validation routine to check the fields and make the form fail validation when needed. These filters let you run custom code for it:
Another easier approach could be to make the form to fail validation if a Total field in your form is 0. There’s an example in the documentation that would work out of the box, you only need to update the id of the field.