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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:26:36+00:00 2026-05-25T01:26:36+00:00

What I want to do: Every time I click a table row it goes

  • 0

What I want to do: Every time I click a table row it goes into edit mode. When I click another row, the row I clicked previously exits edit mode and the one I just clicked goes into edit mode.

The following code is in an included JavaScript file. I have a function that makes table rows editable.

function editRow(row) {
    /* awesome code here */
}

and have the events ready…

$(".editable_title").click(function() {
    editRow(this.parentNode);
});`

What I have tried:

  1. Put the code in between $(document).ready(function() { }); but it only works with the first click and the first edit submission. But then, if I try to do it again, it just doesn’t work.

  2. Just put the code by itself in the included file without the $(document).ready(function(){ });. Then use onclick events on the tr’s. Problem:

    1. The JavaScript is intrusive.
    2. If I click on the same row more than once, it keeps on triggering the event multiple times; and if I click in different rows, all of them go into edit mode at the same time.

I know it’s just a matter of having an constant event listener and using unbind. I tried using .live() which worked well but then I couldn’t get .die() to work.

Can you please give me some suggestions?

  • 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-25T01:26:36+00:00Added an answer on May 25, 2026 at 1:26 am

    Try this

    $(".editable_title").one(function() {
        editRow(this);
    });
    
    function editRow(row) {
        var rowNode = row.parentNode;
        /* awesome code here */
    
    
        //Attach the click event here again after editing is done
        //If you are doing any ajax calls then this should be done in the success callback
        $(row).one(function() {
           editRow(this);
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to increment a cookie value every time a page is referenced even
I have a winforms app and i want to keep track of every time
I want to create a custom control in C#. But every time I have
I want every cell in each row except the last in each row. I
I want so send every week an update by email. But Im afraid that
In the following code I want to replace every occurrence of U.S.A with united
Unchecked exceptions are alright if you want to handle every failure the same way,
I have an object of the type System.Drawing.Image and want to make every pixel
I want to write a script which cleans the 'run' dialogue automatically every log
I want my asp.net mvc framework system to send an e-mail everytime a certain

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.