Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 401821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:04:08+00:00 2026-05-12T17:04:08+00:00

I am working to get each value of the checked element and post them

  • 0

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.

here is

$("#conf").click(function(){
    var count = $("input:checked").length;
    for(i = 0; i < 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");
    }
});

And HTML

<?php while ($info = mysql_fetch_assoc($result)) { ?>
<tr class="req">
    <td style="width: 29px">
        <input name="confirm" type="checkbox" id="<?php echo $info['ID']; ?>" value="<?php echo $info['ID']; ?>" />
    </td>
    <td style="width: 70px" class="style5"><?php echo $info['email']; ?></td>
    <td style="width: 72px" class="style5"><?php echo $info['name']; ?></td>
    <td style="width: 88px" class="style5"><?php echo $info['username']; ?></td>
    <td style="width: 76px" class="style5"><?php echo $info['country']; ?></td>
    <td style="width: 76px" class="style5"><?php echo $info['bus']; ?></td>
    <td style="width: 67px" class="style5"><?php echo $info['website']; ?></td>
    <td style="width: 97px" class="style5"><?php echo $info['music']; ?></td>
    <td style="width: 78px" class="style5"><?php echo $info['radio']; ?></td>
</tr>
<?php } ?>

How can i get value of checked items in that for loop ?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T17:04:09+00:00Added an answer on May 12, 2026 at 5:04 pm

    Change

    a = $("input:checked").val();
    

    to

    a = $("input:checked").eq(i).val();
    

    This will get you the value for each subsequent item.

    And use Firebug! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't get epylint working. I'm using buildout to generate epylint script. But then I
I've been trying to get this working for a while now and am just
I can't figure out how to get .each working when using a relative path
Here's my code I'm trying to get working to no avail: CREATE DEFINER=`auser`@`localhost` PROCEDURE
I have this simple example I can't seems to get working : MERGE INTO
i am new in programming under linux and trying to get working this code:
I have a script that I'm trying to get working. Basically, what I'm trying
I have a data access class that took me a while to get working.
can't get sorting working for a django-tables2 table. class MyModel(models.Model): pid = models.AutoField('id',primary_key =
I've been trying to get something working in a windows 8 metro style application,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.