良いコメントを削除することはできません。常に最後のコメントを削除します。
私のjs:
$(function () {
$( ".delete" ).click(function() {
$( "#delete-confirm" ).dialog( "open" );
});
$( "#delete-confirm" ).dialog({
autoOpen: false, modal: true, width: '600px', show: 'fade',
buttons: {
"Confimer": function() {
$( this ).dialog( "close" );
$('.form-comment').append('<input type="hidden" name="delete" />');
$(".form-comment").submit();
},
"Annuler": function() {
$( this ).dialog( "close" );
}
}
});
});
そしてPHPでは:
<?php
foreach ($commentManager->getList() as $comment) { ?>
<form class="form-comment" method="post" style="display: inline;">
<input type="hidden" name="id" value="<?php echo $comment['id']; ?>" />
</form>
<?php } ?>
phpページの中央にjqueryコードを配置せずに、適切なIDでフォームを送信するにはどうすればよいですか?