handling a POST request
<p>I am trying to POST some data but I am not achieving what I need to. </p>

<p>No matter what <code>list-item</code> I click on, it is POSTing the value of the top most <code>list-item</code>. </p>

<p>this is the jquery function: </p>

<pre><code>$(".list-item-wrap a").click(function(){
    $.post("display2.php", { 
        msg_id: $(".list-item-wrap a .list-item").find('input').val()},
        function(data) {
            $("#list").load("display2.php", {
                msg_id: $(".list-item-wrap a .list-item").find('input').val()
            });
        //window.location.replace("display2.php");
    })
})
</code></pre>

<p>This is the actual html/php data: </p>

<pre><code>&lt;?php

$query = "SELECT * from workflow WHERE name = '$username' ORDER BY msg_id DESC";
$result = mysql_query($query) or die("ERROR: $query.".mysql_error());

while ($row = mysql_fetch_object($result)) {
    echo "&lt;div class=list-item-wrap&gt;";
    echo "&lt;a href='#'&gt;&lt;div class=list-item&gt;&lt;input class=msgid type=hidden value="
              .$row-&gt;msg_id."&gt;";
    echo "&lt;b&gt;&lt;h1&gt;".$row-&gt;subject."&lt;/h1&gt;&lt;/b&gt;".substr($row-&gt;message, 0, 200)
              ."...&lt;br&gt;&lt;b&gt;".$row-&gt;sender."&lt;/b&gt;";
    echo "&lt;/div&gt;&lt;/a&gt;&lt;/div&gt;";
}
?&gt;
</code></pre>

<p>Where am I going wrong??</p>
