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

I been trying to get sqlcachedependecy working, but it doesn't appear to work I
I am trying to get PhysX working using Ubuntu. First, I downloaded the SDK
I'm trying to get MSBuild working on a project that has just been moved
Working to get DateTimes for any time zone. I'm using DateTimeOffset, and a string,
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 SOAP client in Ruby that I'm trying to get working with
I always seem to use Get when working with data (strongly typed or otherwise)
I'm trying to get tags working in my rails application and want to use
I'm trying to get authentication working to my liking in a CakePHP app and

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.