Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to get value of checked element in for loop
    primarykey
    data
    text
    <p>I am working to get each value of the checked element and post them to php. But it only gets first value of just one checked item.</p> <p>here is </p> <pre><code>$("#conf").click(function(){ var count = $("input:checked").length; for(i = 0; i &lt; count; i++) { a = $("input:checked").val(); $.post("reqs.php?act=confirm", { ID: a }, function(data) { }); $('#'+a).parents(".req") .animate({ backgroundColor: "#fbc7c7" }, "fast") .animate({ opacity: "hide" }, "slow"); } }); </code></pre> <p>And HTML</p> <pre><code>&lt;?php while ($info = mysql_fetch_assoc($result)) { ?&gt; &lt;tr class="req"&gt; &lt;td style="width: 29px"&gt; &lt;input name="confirm" type="checkbox" id="&lt;?php echo $info['ID']; ?&gt;" value="&lt;?php echo $info['ID']; ?&gt;" /&gt; &lt;/td&gt; &lt;td style="width: 70px" class="style5"&gt;&lt;?php echo $info['email']; ?&gt;&lt;/td&gt; &lt;td style="width: 72px" class="style5"&gt;&lt;?php echo $info['name']; ?&gt;&lt;/td&gt; &lt;td style="width: 88px" class="style5"&gt;&lt;?php echo $info['username']; ?&gt;&lt;/td&gt; &lt;td style="width: 76px" class="style5"&gt;&lt;?php echo $info['country']; ?&gt;&lt;/td&gt; &lt;td style="width: 76px" class="style5"&gt;&lt;?php echo $info['bus']; ?&gt;&lt;/td&gt; &lt;td style="width: 67px" class="style5"&gt;&lt;?php echo $info['website']; ?&gt;&lt;/td&gt; &lt;td style="width: 97px" class="style5"&gt;&lt;?php echo $info['music']; ?&gt;&lt;/td&gt; &lt;td style="width: 78px" class="style5"&gt;&lt;?php echo $info['radio']; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; </code></pre> <p>How can i get value of checked items in that for loop ?</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload