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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T00:51:22+00:00 2026-05-18T00:51:22+00:00

I found some fantastic code that meets the needs for my project from here:

  • 0

I found some fantastic code that meets the needs for my project from here:

http://www.askthecssguy.com/examples/rowlock/example9.html

I’ve modified the code so that when the user selects an item and then clicks a button the data is processed (e.g. erase the data from a database on the server)

I have not been able to figure out is how to disable the action from occurring again. I’ve tried disabling the radio button. The code somehow reactivates the radio button. I’ve set the radio button to null. That too didn’t work.

My last thought was to change the text in the 2nd column (the first is the radio button) as a means of testing if the code has already been deleted but I simply can’t figure out how to access that column and modify the text.

This is the original code from the link above:

function lockRow() {
var tables = document.getElementsByTagName("table");
for (var m=0; m<tables.length; m++) {
    if (tables[m].className == "pickme") {
        var tbodies = tables[m].getElementsByTagName("tbody");
        for (var j=0; j<tbodies.length; j++) {
            var rows = tbodies[j].getElementsByTagName("tr");
            for (var i=0; i<rows.length; i++) {
                rows[i].oldClassName = rows[i].className;
                rows[i].onclick = function() {
                    if (this.className.indexOf("selected") != -1) {
                        this.className = this.oldClassName;
                    } else {
                        removeSelectedStateFromOtherRows();
                        addClass(this,"selected");
                    }
                    selectRowRadio(this);
                }
            }
        }
    }
}

Which I hacked down to:

function testloop() 
{
var tables = document.getElementsByTagName("table");
    for (var m=0; m<tables.length; m++)     {       
    var tbodies = tables[m].getElementsByTagName("tbody");
    for (var j=0; j<tbodies.length; j++) {
        var rows = tbodies[j].getElementsByTagName("td");
        for (var i=0; i<rows.length; i++) {
          r = rows[ i ] ;
                 // r is the radio button. 
                 //How do I access the text in the 2nd column?
        }           
    }
}

}

If the row with ‘Domestic’ was selected, I’d like to change ‘Domestic’ to ‘Deleted’. I can detect that in other code and handle that action.

Does this make any sense? Is there a smarter or easier way of what I’m trying to accomplish? My Javascript abilities are sorely lacking. Thank you.

<tr>
<td>
    <input
        type="radio"
        name="choice"
        value="walalala" />
</td>
<td>Domestic</td>
<td>Titanic</td>
<td>$600,788,188</td>

  • 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-18T00:51:23+00:00Added an answer on May 18, 2026 at 12:51 am

    You have several choices depending on what you really want to do.

    1. You can simply remove the corresponding row – user can’t select it and other code won’t find it.
    2. You can add for example “removed” class to the row/input when user sends it to your server. Next time user wants to send anything, check if currently selected row doesn’t have “removed” class.
    3. Same as 2 but using HTML5 data-xxx attributes.

    Something like this should work (using jQuery):

    $('button').click(function(event) {
      var i = $('input:checked');
      if (i.hadClass('removed'))
        event.preventDefault();
      else
        i.addClass('removed');
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I found some code at http://labnol.blogspot.com/2006/12/allow-site-visitors-to-change-font.html to allow folks to change font size and
I found some examples of how to create a excel file from a data
I found some examples about this subject. Some of the examples gived a method
i found some examples how to apply texture on 2d object but nothing on
I found some exercises where you combine n-bit 2's complement values in different ways
I found some instructions how to configure pure hibernate to use EHCache. But I
I've found some weird C++ preprocessor clauses, like: #define COMPILER_FLOAT_ENTRIES_DO(template) and #define COMPILER_FLOAT_ENTRIES_DO(template) \
comrades) I've found some interesting behavior of Invalidate method in multithreaded applications. I hope
I have found some similar questions like this one, however there are so many
Integrating SimpleModal with ASP.NET I want to thank Eric for producing SimpleModal and compliment

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.