0
How do I when php loops with multiple forms like this
<form url="deletar_convidado.php" method="post" id="reg-form_3<?php echo $i_content ?>" autocomplete="off" style="border:none; float:left; width:50px">
<input type="hidden" name="i_content" id="i_content" value="<?php echo $i_content ?>">
<input type="hidden" name="auxiliar_evento_usuarioss" id="auxiliar_evento_usuarioss" value="<?php echo $produto["auxiliar_evento_usuario"] ?>">
<input type="hidden" name="deletar_convidado" id="deletar_convidado" value="<?php echo $row_convidado['id']; ?>">
<button class="btn btn-info lista_convidado_1" type="submit"><i class="entypo-cancel-circled"></i></button>
</form>
<div id="form-content_2<?php $i_content++; echo $i_content; ?>" style="clear:both;"></div>
realize that there reg-form_3 and also **form-content_2"**I created so I can delete the files when I’m in loop.
I am doing so, works only on the first record of Loop php, the rest does not work
$(document).on('click', '#reg-form_3'+$("#i_content").val(), function(e){
e.preventDefault();
$.ajax({
url: 'deletar_convidado.php',
type: 'POST',
data: $(this).serialize()
})
.done(function(data){
alert($("#i_content").val());
$('#form-content_2'+$("#i_content").val()).fadeOut('slow', function(){
$('#form-content_2'+$("#i_content").val()).fadeIn('slow').html(data);
});
})
.fail(function(){
alert('Ajax Submit Failed deletar convidado...');
});
});