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

  • Home
  • SEARCH
  • 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 6184857
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:36:41+00:00 2026-05-24T01:36:41+00:00

Instead of using a table, I have the following HTML showing a checkbox in

  • 0

Instead of using a table, I have the following HTML showing a checkbox in col 1, a name in col 2, and an EMail address in col 3. The HTML looks like this:

<div class="rowLight">
<div class="select"><input name="checkbox" id="chk1" class="chktbl" type="checkbox"></div>
<div class="name">Mary</div><div class="emayl">Mary@ABC.com</div>
</div>
<div class="rowDeep">
<div class="select"><input name="checkbox" id="chk2" class="chktbl" type="checkbox"></div>
<div class="name">Jerry</div><div class="emayl">Jerry@ABC.net</div>
</div>

I need to iterate through each checkbox, and it the box is checked, capture the name & Email address that will be sent to a webservice which will populate an EMail table. I tried something like this, but need help…

var vals = [];
$('.select input[type="checkbox"]:checked').each(function(i) {
var name = $(this).next('.name');
vals.push(($(name).html());
var emayl = $(this).next('.emayl');
vals.push(($(emayl).html()); });

Thanx,
Jerry

  • 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-24T01:36:42+00:00Added an answer on May 24, 2026 at 1:36 am

    Something like this could work:

    var data = $(".select input:checkbox:checked").map(function() {
        var $parent = $(this).closest(".select");
        return {
            name: $parent.next(".name").text(),
            email: $parent.siblings(".emayl").text()
        };
    }).get();
    

    Note that the data will look like:

    [ { name: '<name>', email: '<email>' }, ... ]
    

    Example: http://jsfiddle.net/andrewwhitaker/rMPDH/


    If you truly want the data in just an array:

    ["<name1>", "<email1>", "<name2>", "<email2>"]
    

    You could try:

    var data = $(".select input:checkbox:checked").map(function() {
        var $parent = $(this).closest(".select");
    
        return [ $parent.next(".name").text(), $parent.siblings(".emayl").text() ];
    }).get();
    

    Example: http://jsfiddle.net/andrewwhitaker/4GdC8/


    Notes:

    • Using the handy .map to take a jQuery result and transform it into the data you need.
    • Calling .get() at the end of the .map call forces the resulting object into a proper array (as opposed to a jQuery object)
    • Uses .closest(), .next(), and .siblings() to retrieve the proper data.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Instead of using $this->fetchAll('email = ?',$email)->current() inside the model class, is there a way
Instead of using an interface like this: public interface IStartable { void Start(); void
I was using the following code to retrieve HTML snippets from a database table
I have a table name Discount that has the following schema: PK DiscountID int
I have the following JTable which uses a table model: http://s17.postimage.org/7zfh3l4lr/Screen_Shot_2012_03_10_at_15_11_31.png Instead of using,
I have basically the following table, Categories id name categories_id_categories 1 Clothes null 2
instead of using getParameterByName('Field', PostData) (PostData == $('form').serialize();) I would like to write PostData.Field,
This is pretty much a duplicate question but instead of using Castle Dynamic Proxy
I have an HTML/XML table generated by AJAX that displays limited columns of a
I am using Zend Dom component to parse some Html blocks, but i have

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.