I'm trying to send a post without refresh with this method below but only sends the first form the second it redirects to page, I'm with the forms within a while PHP
$(function($) {
$('#enviaadv').submit(function() {
$(this).ajaxSubmit(function(resposta) {
if (!resposta){
$onclick = showadv('bottom','left',resposta);
}
else
{
$onclick = showadv('bottom','left',resposta);
}
});
return false;
});
});
</script>
<form id="enviaadv" action="functions/advogadoresponsavel.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="advid" value='awdawd'>
<input type="hidden" name="advnome" value='awdawd'>
<input type="hidden" name="idunico" value='adawdaw'>
<button class="btn btn-success btn-link btn-just-icon btn-sm">
<i class="material-icons">person_add</i>
</button>
</form>
<form id="enviaadv" action="functions/advogadoresponsavel.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="advid" value='dawd'>
<input type="hidden" name="advnome" value='awdawd'>
<input type="hidden" name="idunico" value='awdawd'>
<button class="btn btn-success btn-link btn-just-icon btn-sm">
<i class="material-icons">person_add</i>
</button>
</form>