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 7527461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:06:43+00:00 2026-05-30T04:06:43+00:00

i have a table in which every rows have a checkbox associated with the

  • 0

i have a table in which every rows have a checkbox associated with the row ( same name ). So i want to let user to select one or more checkbox and delete it. The problem is that rows belong to two class of information. so i have row with classname 1 and rows with classname 2. This is code i develope till now:

function delete() {
    // here i take all the checkbox checked
    var checked = $("input[type=checkbox]:checked");
    // the number of checkbox checked
    var nbChecked = checked.size();
    // just to the dialog
    var b = nbChecked == 1 ? "notification" : "notifications";
    if (confirm('Are you sure to delete [' + nbChecked + '] ' + b + "?\nTake care.. you cannot resume the action!")) {
        if (nbChecked > 1) {
            // i want to generate a matrix. every row has an array of information.
            var arr1;
            // i take this code on web, but it doesn't work. I want to pur in sent all 
            // the tr with class sent and with input checkbox associated with it checked.    
            var sent = $('.mainTable').find("tr.sent input[type=checkbox]:checked").get();
            //HERE i want to iterate array sent to take all the information of td inside it and pur in arr1.
            //HERE THE SAME DONE STILL NOW BUT CHANGING TR CLASS              
        } else {
            // HERE IS SIMPLE
        }
    }
}​

EDIT:
This one of the row with classname sent:

<TR valign=top name="rowSent1" style="background-color: #33CCCC" class="sent">
   <input type="hidden" value="messageRowSent1" name="message"/>
   <TD width=12>
      <div class="wpmd">
         <div align=center>
        <font color="#FF0000" class="ws7">
           <input type="checkbox" name="rowSent1" onchange="analizeCheckBox()"/> // onchange to check inputs checked
     </div>
      </div>
   </TD>
   <TD width=147 >
      <div class="wpmd">
         <div align=center>
        <font color="#000000" class="ws7"><I><div class="info1">info1</div></I></font>
     </div>
      </div>
   </TD>
   <TD width=156 >
      <div class="wpmd">
         <div align=center>
            <font color="#000000" class="ws7"><I><div class="info2">info2</div></I></font>
         </div>
      </div>
   </TD>
</TR>

Then i have other rows with the same class and other rows with another classname.

Can you help me? 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-30T04:06:44+00:00Added an answer on May 30, 2026 at 4:06 am

    I make this and it’s work:

    function getMatrix(type){
                    var array;
                   if(type=="sent"){
                      array = $("tr.sent input[type=checkbox]:checked").toArray()
                   }else{
                      array = $("tr.period input[type=checkbox]:checked").toArray()
                   }
                            var total = new Array();
                            for(var i=0;i<array.length;i++){
                                var tds = $(array[i]).parents("tr").children('td').toArray();
                                var mess = $(array[i]).parents("tr").children('input[type=hidden]').val();
                                var middle = new Array();
                                middle.push(mess);
                                for(var j=0;j<tds.length;j++){
                                    var ii = $(tds[j]).text();
                                    middle.push($.trim(ii));
                                }
                                total.push(middle);
                            }
                            return total;   
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table on which I want to perform some operations every hour.
I have a table in which approx 100,000 rows are added every day. I
I have a very large (millions of rows) SQL table which represents name-value pairs
I have some a table in which i have rows with same id and
I have a table which holds flight schedule data. Every schedule have an effective_from
I have a innoDB table which records online users. It gets updated on every
I have a table which has several one to many relationships with other tables.
I have a table which needs to link one of three seperate tables, but
I have table called page which represents every single page in my website. page_id
I have a table with 200 rows. I'm running a cron job every 10

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.