我不能删除好的评论,它总是删除最后一个。
我的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 } ?>
我如何提交具有良好 id 的表单而不将我的 jquery 代码放在 php 页面的中间?