Form Submitting even if no file is uploaded

Issues related to forms.
Post Reply
Gandalf_the_Gray
 
 
Posts: 10
Joined: Wed Nov 13, 2019 12:28 pm

Form Submitting even if no file is uploaded

Post 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.
User avatar
wwonderfull
 
 
Posts: 1558
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: Form Submitting even if no file is uploaded

Post 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.
User avatar
Pablo
 
Posts: 23234
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Submitting even if no file is uploaded

Post 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.
Gandalf_the_Gray
 
 
Posts: 10
Joined: Wed Nov 13, 2019 12:28 pm

Re: Form Submitting even if no file is uploaded

Post 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.
User avatar
Pablo
 
Posts: 23234
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: Form Submitting even if no file is uploaded

Post by Pablo »

The validation on your website seems to work for me.
Can you please describe what does not work?
Post Reply