I have an input:
<input id="imagens" type="file" multiple name="file" accept="image/x-png,
image/gif, image/jpeg" required />
And the following javascript code:
var fileUpload = document.getElementById("imagens");
var enviar = document.getElementById("enviar");
enviar.addEventListener("click", function (event) {
if (fileUpload.files.length == 0) {
alert("Nenhum Arquivo Selecionado");
return;
}
})
I would like to see a modal bootstrap instead of alert if the user tried to submit the form without images.