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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T22:54:05+00:00 2026-06-17T22:54:05+00:00

I need a function that adds and removes a column in a table if

  • 0

I need a function that adds and removes a column in a table if a checkbox is checked or not. The code I got at the moment works fine to an extend. The console messages come up at the right time and the table column is correctly added to the HTML.

The problem lies in the else{} part: The columns are not removed when checkbox is unchecked. In firebug I get a message that my selector is wrong but I am not sure how to fix it. And assuming the selector was correct, is my application of .detach(this) correct?

 function makevisible(idsandclasses,object,folder){     
    $('#checkbox'+idsandclasses).change(function() {
      console.log(idsandclasses, "before if checked")

    if($('#checkbox'+idsandclasses).is(':checked')){
       console.log(idsandclasses, "if checked")
       $('tr:contains("Details")').append('<td id="rowdetails'+folder+'">'+object.name+'</td>')
       }else{
             console.log("unchecked")
             $('#rowdetails'+folder).detach(this)
             }  
    })
};

Here I use the function:

$(document).ready(function() {
    $("#dot0001").hover(makevisible("info0001", object0001,"object0001"))
})

This is the firebug message:

TypeError: expr.replace is not a function
expr = expr.replace( rattributeQuotes, “=’$1′]” )

And this is the part in my jquery-1.9.0.js file my code has problems with:

expr = expr.replace( rattributeQuotes, "='$1']" );

I assumed there is no need for the HTML. If that should be the case though let me know.

  • 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-17T22:54:06+00:00Added an answer on June 17, 2026 at 10:54 pm

    Remove this from detach. Just .detach() is sufficient.

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

Sidebar

Related Questions

I have a function that uses a mouse event and it removes and adds
I need a function that can add checkbox values on click event. My html
I'm making a helper function that, amongst other things adds or removes a class.
I need a function that adds interval to a given time string. Example: string
I need a function that could generate a regex. For example if I write
I need a function that can intersect 2 arrays for example: $Array1 = array(1,2,3);
I need a function that can print Turkish characters. public String convert(String input) {
I need a function that can return the difference between the below two dates
I need a function that returns the ASCII value of a character, including spaces,
I need a function that a user can just click a flash app button

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.