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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:50:18+00:00 2026-05-11T22:50:18+00:00

how do i bring the tr value into .click event? i want to be

  • 0

how do i bring the tr value into .click event?
i want to be able to pass the tr id into updatedb.php as well- for sql updating

enter

<head>
<script src="jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="jquery.jeditable.mini.js" type="text/javascript"></script>

<script type="text/javascript">

    $(document).ready(function() {

var global= ""

$('.click').click(function() {
    var $this = $(this);
    var $tr = $this.closest('tr');

alert($tr.attr('id'));
global= $tr.attr('id');

});


    $('.click').editable('updatedb.php?test=123', { 
        indicator : "<img src='indicator.gif'>",
        tooltip   : "Click to edit...",
        onblur : 'submit',
        style  : "inherit"

    });


    });

</script>

</head>
<body>      
    <tr id=1>
    <td>
        <span class="click" style="display: inline">Funny click here testing!</span>
        <br />
        </td>    
    </tr>
    <tr id=2>
        <td>    
        <span class="click" style="display: inline">Second inline!</span>
        </td>
    <tr>    
</body>
</html>

here

Hi, jeditable don’t have successor. I finally manage to get the value into global. But now facing another issue. Jeditable doesn’t allow me to pass in extra value…

I tried
editable(‘updatedb.php?test=123’
then echo “START” . $_POST[‘test’] . “END”

I also tried other way, not working.

  • 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-11T22:50:18+00:00Added an answer on May 11, 2026 at 10:50 pm

    You may want to check out the jQuery plugin jEditable, the successor to editable.
    Link: http://www.appelsiini.net/projects/jeditable

    Back to your question, you can get the id of the TR node in your example by asking for the attribute using either parent(), closest() or parents(). I’d recommend against parent() because it expects you to leave the HTML nested exactly like in your example. Better to use parents() or closest() with a filter.

    $(document).ready(function() {
        $('.click').each(function() {
            var $this = $(this);
            var $tr = $this.closest('tr');
            // Do stuff with $tr like checking it, extracting $tr.attr('id') ...
            $this.editable('updatedb.php', {
                indicator : "",
                tooltip : "Click to edit...",
                onblur : 'submit',
                style : "inherit"
            });
        });
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The value for a field (phone number) isn't being correctly entered into the database.
im trying to pass two parameters to a function, i being an int value
I'm trying to delegate a click event to a TR element that contains a
I am creating a upload control in javascript and then using element.click() to bring
I have a page where I ask the user to input a value into
I am trying to pass an array of values into an array of a
I have an event that fires on a button click that calls a stored
I have following code that does not work due to a being a value
In a java program, I am getting some data with each value being assigned
The value of my submit button is being lost if submitted via javascript in

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.