Custom form script to allow submit if one or more of any inputs are filled out - and does not allow submit if none are filled out

Hi everyone.

My client would like a form that customers can submit if one of ANY of the inputs is filled out. If none of the inputs are filled out, then the form won’t submit. At least one of any of them need to be filled to submit.

The form ID is email-form. It has name, number, email, and message inputs. So text inputs and textarea.

I have tried chat gpt to help with the code, but it just won’t work.

I am sharing read only below, can share staging link if necessary.


Here is my site Read-Only:

@Zak_MBC - take a look at this code:

This is the logic for checking if any input on the form has a value. From here you will need to do decide what to do in either scenario. I’m assuming if any field has a value you will submit the form, but if not display a message to the user?