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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:49:57+00:00 2026-06-16T01:49:57+00:00

I have jQuery on() applied to each table row. After user clicks to any

  • 0

I have jQuery on() applied to each table row. After user clicks to any row another page starts loading:

table_tag.on("click", "tbody tr", function(event) {                
    var search_id = datatable.fnGetData(this)[0];                                
    if(event.ctrlKey) {                                                                                        
        window.open("/search/"+search_id+"/");
    } else {
        window.location.assign("/search/"+search_id+"/");
    }
});

I added to a table a new column. Each cell of it has only one checkbox:

<td><input type="checkbox" /></td>

I need to prevent loading another page after user clicking to this checkbox.
I tried this:

table_tag.off("click", "tbody tr td input:parent")

But it is not working. How can I do that?

  • 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-16T01:49:58+00:00Added an answer on June 16, 2026 at 1:49 am

    You don’t have a handler on "tbody tr td input:parent". You have just one handler, on "tbody tr".

    Instead, be more careful what you bind to: "tbody tr :not(input:checkbox)" should be better.

    EDIT: As popnoodles says, the question is not clear. The above is to prevent loading a new page when a user clicks the checkbox (otherwise I imagine the checkbox to be somewhat useless). If your purpose is to disallow opening the new page if you click on rows that have the checkbox set, which is another interpretation of the question I can see, then apply the above patch to your selector, and in addition check the checkbox state from within the handler.

    EDIT2: There was an error with a colon being missing; not(...) is incorrect, should be :not(...).

    EDIT-too-much: Fiddle, with tbody tr td:not(:has(input:checkbox)).

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

Sidebar

Related Questions

I have jQuery draggable set up and working ok on a table row. Currently
I have a table with 1 button in each row, on click of button
I have a table, each row assigned a unique ID so I can click
I have a HTML table where each row has two columns. First column is
I have a web app that I've recently applied a jQuery ThemeRoller theme to.
Here is a jQuery slide function I have applied to a div on hover
I have jQuery code which looks something like this on Button1 Click $('table.result_grid tbody
I have a large table with with each cell being 25x25 and a div
Let's say I have a jquery plugin that has an onSelect attribute. The user
I am using a jQuery's toggleClass() method to handle table row highlighting and what

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.