I can't delete the good comment, it always delete the last one.

my 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" );
                }
            }
        });

    }); 

```

And in 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 } ?>

```

How can i submit the form with the good id withtout put my jquery code in the middle of the php page ?