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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:29:57+00:00 2026-06-15T08:29:57+00:00

I have a table that is built dynamically from a user specified query to

  • 0

I have a table that is built dynamically from a user specified query to a database and I want to give the user the option to edit the data from the generated HTML table. When the user double clicks on the row containing the data they want to edit, I have a new row appear underneath it with textboxes for them to submit new values. Right now, when the user clicks double clicks two rows, both rows of textboxes remain in the table and I want to delete the first row before the second shows up. My question is, what is a good was to find table rows containing textboxes so that I can perhaps use JavaScript’s deleteRow() function?

I’m generating rows like so:

function editRow(row) {
    var table = document.getElementById("data");
    var newRow = table.insertRow(row.rowIndex + 1);
    var cell;

    for (var i = 0; i < row.childNodes.length; i++) {
        cell = newRow.insertCell(i);
        textBox = document.createElement("input");
        textBox.type = "text";
        textBox.placeholder = row.childNodes[i].innerHTML;
        textBox.style.textAlign = "center";
        textBox.style.width = "90%";
        cell.appendChild(textBox);
    }
}

and the only way I can I can think of doing it is something like (pseudo code):

for all table rows 
    if row.childNodes.innerHTML contains 'input' 
        deleteRow(index)

Thanks for the help

  • 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-15T08:29:59+00:00Added an answer on June 15, 2026 at 8:29 am

    I ended up doing the following:

    function editRow(row) {
        var table = document.getElementById("data");
        clearExistingTextBoxes(table);
        ...
    }
    
    function clearExistingTextBoxes(table) {
        var tBoxRow = table.getElementsByTagName("input");
        if (tBoxRow.length > 0) {
        tBoxRow = tBoxRow[0].parentNode.parentNode;
        table.deleteRow(tBoxRow.rowIndex);
        }
    }
    

    Assuming I’m only going to be clearing one row at a time.

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

Sidebar

Related Questions

I have table that I insert data with following query (from c# code): INSERT
I have a local database table that contains 50+ external data sources from which
I build dynamically my HTML table from database like that: for (i = 0;
So i have a table that is built dynamically that adds rows for each
I have an AdvancedDataGrid being built dynamically from an html table. The html is
I have a page that is dynamically built by the database. For each thing
I have built a table from which I allow the user to add and
I have a table that is dynamically built using DOM. It has 10 cols,
I have a table that has account numbers in (account_num) and user profiles (profile_id).
I have a table that stores data that has been entered regarding the amount

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.