Good afternoon. I need to include a button on my edit form so that I can delete the user's photo. I would like to do with jquey and ajax, I'm still learning. I am using mysql which stores only the path of the photo, the file is in a folder on the server. Could someone give at least one way forward ... or some idea Below is my code:
<div class="form-group">
<label for="foto_aluno" class="col-sm-2 control-label">Alterar foto</label>
<div class="col-sm-10">
<input type="file" class="form-control-file" id="foto_aluno" name="arquivo">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button class="btn btn-danger btn-sm" id="btn_excluir">Excluir foto</button>
</div>
</div>
At the bottom of the page:
<script type="text/javascript">
$(document).ready(function(){
$('#btn_excluir').click(function(){
alert('Aqui o código para excluir');
})
})
</script>