Page 1 of 1

Form Submitting even if no file is uploaded

Posted: Wed Sep 06, 2023 4:12 am
by Gandalf_the_Gray
Hi!

Is there a way to stop a form from being submitted (via the submit button) when a required file is not uploaded?

I've been tweaking my editbox conditions to prevent the form from sending without the data, but I can't set such conditions on file uploads. The form submits anyway, even if I have set a validation that the info (presumably files) must be there, as long as my editbox conditions are fulfilled.

Here's the URL of the page - https://brains.com.ph/notify_us_0906.php

Here are the links to the project file and folder:

https://docs.google.com/document/d/1YWu ... ue&sd=true

https://drive.google.com/drive/folders/ ... sp=sharing

Advice is much appreciated. Thank you in advance.

Re: Form Submitting even if no file is uploaded

Posted: Wed Sep 06, 2023 5:03 am
by wwonderfull
I think you need to set proper validation like html5 which is easy to set or if advanced then bootstrap validation. That will for sure solve it.

Re: Form Submitting even if no file is uploaded

Posted: Wed Sep 06, 2023 6:06 am
by Pablo
Your form is pretty complicated, so it difficult to see what is going on.
Although I did a quick test and it asks me to upload a file, so that seems to work?

But I suggest to start with a small form (for example, with only one field and one file upload) to try to see if you can make that work like you want.
Once you have that working you can implement in your real form.

Re: Form Submitting even if no file is uploaded

Posted: Wed Sep 06, 2023 6:18 am
by Gandalf_the_Gray
Actually, Pablo, the whole thing does not work anymore. The form sends even without any data.

Even when it asks you to upload a file, or fill in the information, the email is already sent.

And I set the submit button as disabled as default.

Re: Form Submitting even if no file is uploaded

Posted: Wed Sep 06, 2023 7:26 am
by Pablo
The validation on your website seems to work for me.
Can you please describe what does not work?