如何在许多状态php和jquery中发送Comment


how send Comment at many statut php and jquery

对不起,我的英语很差

我想问我如何发送评论在许多状态

这个状态是在

           <form id="com" name="<?php $row[id_statut] ?>">
            <div>
             <textarea id="comm" name="comm"></textarea>
            </div>
          </form>

这个代码jquery

    $("form#com").submit(function() {
        var thiscom = $(this);    
        $.post("commentaire.php", {
          comm: $('#comm').val(),
          statut: $(thiscom).attr('name')      
        },function(data) {
          if (data=='ok') {
           $('#comm').val("");
          }
        }, "json");
        return false;
    });

现在的问题是,他只是在第一个状态下发表评论我不知道为什么?!帮帮我:'(

我想这就是你想要的,但你的问题不是很清楚。。。我希望我理解得对。

<form id="com">
  <div>
    <input type="hidden" name="statut" value="<?php $row[id_statut] ?>">
    <textarea id="comm" name="comm"></textarea>
  </div>
</form>
$("form#com").submit(function() {
    var thiscom = $(this);    
    $.ajax({
       type: "POST",
       url: "commentaire.php",
       data: thiscom.serialize(),
       success: function(data) {
           if (data=='ok') {
               $('#comm').val("");
       }
    });
    return false;
});