Colleagues.
I have a website where the form is validated with Jquery through a modal Bootstrap and everything is OK the message is sent. But we've included a file field for file uploads. The problem we're encountering is that the file does not go to the submit validation page:
<form role="form" class="contact-form" id="contact-form" method="post" enctype="multipart/form-data">
<div id="final" class="form-group invisivel radio">
<div class="form-group">
<label for="Arquivo">Arquivo:</label>
<div class="input-group margin-bottom-sm">
<span class="input-group-addon"><i class="fa fa-upload fa-fw" aria-hidden="true"></i></span>
<input name="Arquivo" class="form-control" type="file" placeholder="Envie arquivo">
</div>
<small id="emailHelp" class="form-text text-muted">Arquivos suportados: PDF, .doc e .docx</small>
</div>
</div>
JQUery
<script>
$('form').submit(function () {
function (d) {
$.post("enviar.php", $(".contact-form").serialize(), function(d) {
$('#success').html(d);
$('#myModal').find(".modal-body").html(d);
$('#myModal').modal('show');
});
return false;
});
</script>
PHP
echo $_FILES['Arquivo']['name'];
How would I do by leveraging the jquery code for validation with Modal Bootstrap?