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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T23:49:16+00:00 2026-06-03T23:49:16+00:00

I have a table with n number of rows with checkboxes and a what

  • 0

I have a table with n number of rows with checkboxes and a what i want to do is if i select a checkbox the value should go to the text area, so i stored all elements in an array first, but it isnt happening, as you can see i added alerts as well to check it out. please help.

window.onload = function () { 
    var oRows = document.getElementById('rnatable').getElementsByTagName('tr');
    var iRowCount = oRows.length;
    alert('Your table has ' + iRowCount + ' rows.');

    var i = 0;
    cb = new Array(iRowCount);
    while (i <= iRowCount) {
        var id = 'check'+ i;
        cb[i] = document.getElementById(id);
        i++;
    }
    //alert('Your table has ' + cb[i].value + ' rows.');
    for(var a=0; a < iRowCount; a++) {
        var fasta = document.getElementById('fasta');
        if(cb[a].checked) {
            fasta.value = cb.value + ","; 
        };
    };
}
  • 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-06-03T23:49:18+00:00Added an answer on June 3, 2026 at 11:49 pm

    Are you seeing an error in the console? I suspect that when while (i <= iRowCount) runs when i === iRowCount that document.getElementById(id) isn’t yielding a result, and that then when you use that value, bad things happen.

    Also, each lap through the fasta loop overwrites the previous value. You probably want something like fasta.value += cb.value + ","; instead.

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

Sidebar

Related Questions

I have a table with large number of rows(~200 million) and I want to
I have a table with multiple rows which contain form inputs (checkboxes, text, dropdowns).
I have a table with a number of rows, I then want to highlight
In each table have many number of rows with amount. Like this i have
I have a table and can count the number of rows using var count
I have an HTML table with a large number of rows, and I need
I have an HTML table filled with a number of rows. How can I
I have a table - xxxx_nb_lo_update_date - with a number of columns and rows
I have a table like: id number year I want to find holes, or
I have table in wordpress admin panel: <tr> <td><input style=width:80% type=text name=ism value= /></td>

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.