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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T17:17:49+00:00 2026-05-20T17:17:49+00:00

I have a table with multiple rows, with each row having a button within

  • 0

I have a table with multiple rows, with each row having a button within the tag. There is also a link within each td tag that when the user clicks, THAT corresponding button is supposed to show, but when I click on the link, ALL the buttons show.

Here is the html:

            <tr>
            <td width="10%" align="center"></td>
            <td width="80%" align="left"><span style="font-weight:bold;"><a href="javascript:void(0);" class="editText">About Me</a>:</span>&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" class="userDetails" style="display:none;" value="Save"/></td>
            <td width="10%" align="center"></td>
        </tr>
        <tr>
            <td width="10%" align="center"></td>
            <td width="80%" class="originalText" align="left" valign="top">
            '.$aboutMe.'
            </td>
                <td width="80%" class="aboutMe" align="center" valign="top">
                    <div style="display:none; font-weight:bold; color:red;" class="msgStatusText"></div>
                    <textarea class="textBox" cols="20" rows="auto"  style="display:none;">
                    '.$aboutMe.'
                    </textarea>
                </td>
            <td width="10%" align="center"></td>
        </tr>

and here is the jquery:

                $(function(){
                $(".editText").each(function(e){
                    $(this).unbind("click").click(function(e){//if user clicks on title (aboutMe,etc)
                        e.preventDefault();     

                            //get handle for textArea           //IF ANY EDITS, WILL BE IN THE VAR SECTION HERE
                            var textAreaHandle = $(this).parents("tr").next().find(".originalText"); //original userText
                            var oldTextValue = jQuery.trim($(textAreaHandle).text()); //trim value, else will not compare properly
                            var editTextBox = $(this).parents("tr").next().find(".textBox"); //handle for textarea
                            var fieldName = $(editTextBox).parent("td").attr("class"); //fieldName
                            var buttonHandle = $(this).parents("td").find(".userDetails");//WORKS, but gets ALL buttons, not just the corresponding one
                            var msgStatusHandle = $(this).parents("tr").next("tr").find(".msgStatusText"); 

The button is shown using the following code, which is ok, it’s just the handle to the corresponding button (code above) that is messed up:

buttonHandle.css({"visibility":"visible"}).show();

There are multiple rows, each with the same structure as the one above so if user clicks on one row, only that corresponding button should show.

Somebody please tell my what I am doing wrong. Whatever I do, I can’t seem to get this working.
Thanks a bunch!

  • 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-20T17:17:50+00:00Added an answer on May 20, 2026 at 5:17 pm

    Change this line:

    var buttonHandle = $(this).parents("td").find(".userDetails");
    

    To this:

    var buttonHandle = $(this).closest('td').find('.userDetails');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table with multiple rows. Each row has a check button. How
I have a table with multiple rows. Each row is a form. I want
I have a table with multiple rows in each row is a select list
I have a table with multiple rows, and each row contains three cells. Each
I have multiple rows in a table, in one of which is a link
I have a table which has two fields. There can be multiple rows with
I have a table with game scores, allowing multiple rows per account id: scores
I have a table UserAliases ( UserId, Alias ) with multiple aliases per user.
I have a table with a Date column. Each Date may appear multiple times.
A table that extends onto multiple printed pages will have its thead and tfoot

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.