Can only read first value from form list using jQuery and PHP
<p>I´m trying to build a shopping cart in jQuery and PHP but cannot read values from form list.
When trying to get value from the form that is submitted i only get values from 
the first form in the list view.</p>

<p>Please look at behaviour here: 
<a href="http://www.adlertz.se/index.php?op=prodlist&amp;katID=9&amp;sidemenu=menushop" rel="nofollow">http://www.adlertz.se/index.php?op=prodlist&amp;katID=9&amp;sidemenu=menushop</a></p>

<p>Click buy on ex. the middle, you get value from first.</p>

<p>Please help me with this, i have benn looking for solution for three days.
Probably a simple problem but i cant find the answer anywhere :| !!!.</p>

<p>Many thanks in advance!</p>

<pre><code>     function prodlist(){
$katID = $_GET['katID'];

$sql = mysql_query("SELECT * FROM shop_prod WHERE kategoriID=$katID");

while ($rad=mysql_fetch_array($sql)) {
    echo "&lt;div class=\"shop_prod_list\"&gt;";
        echo "&lt;div class=\"shop_prod_list_tmb\"&gt;&lt;img src=\"shop/images/prod_images_tmb/".$rad['prodID'].".png\" alt=\"\"&gt;&lt;/div&gt;";

        echo "&lt;form id=\"addcartform\" class=\"addcartform\" method=\"post\"&gt;";
        echo "&lt;input type=\"hidden\" name=\"prodID\" id=\"prodID\" value=\"".$rad['prodID']."\" /&gt;";
        echo "&lt;input type=\"submit\" class=\"shop_prod_list_kundvagn\" value=\"\" id=\"addcart\"/&gt;";
        echo "&lt;/form&gt;";

    echo "&lt;/div&gt;";
}
echo "&lt;div id=\"search_results\"&gt;&lt;/div&gt;";
</code></pre>

<p>}</p>

<pre><code>  $(document).ready(function(){ 

$(".addcartform").click(function(e){ 
    e.preventDefault(); 
    addcart(); 
}); 
</code></pre>

<p>});</p>

<pre><code>   function addcart(){ 

var prodID=(this).document.getElementById('prodID').value; &lt;-(Reads value but only the first)

$.post("functions/cart.php", {prodID : prodID}, function(data){
    if (data.length&gt;0){ 
        $("#search_results").show();    
        $("#search_results").html(data);
    } 
}) 
</code></pre>

<p>}</p>

<pre><code>   &lt;?php
  include "db_config.php";
  include "db_connect.php";

$prodID = strip_tags(substr($_POST['prodID'],0, 100));
$prodID = mysql_escape_string($prodID);

echo $prodID ." is added.";
</code></pre>

<p>?></p>
