Skip to content
Advertisement

If I don’t choose a file and press the send button, I will get a popup but it’ll break any future popups

If I press Send ☞ without choosing a file, it’ll say “No file selected.” in a little Bootstrap warning alert but it seems to break all future alerts like file uploaded or file already exists on disk.

If I make an error alert like file already on disk, it’ll work and won’t break future alerts (meaning it won’t stop alerts that popup in the future from showing).

So, why is the “No file selected” alert breaking other alerts?

In this clip, you can see me trying to make more than one of that alert but it just doesn’t want to.

Here is my ejs file:

JavaScript

Advertisement

Answer

You should move the flag sending = true when you actually plan to send after validation. I would also place sending = false right when callback returns, even if err

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement