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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:22:28+00:00 2026-05-22T15:22:28+00:00

I need some help pulling cell data from table when a user clicks the

  • 0

I need some help pulling cell data from table when a user clicks the an button at the end of the table row. The table is generated via Ajax technique. I’m not sure if this makes a difference when accessing elements of the table.

<script type='text/javascript' src='jquery.js'></script> 
  <p>** click me **</p>
  <br/>
  <div id="placeHolder">some text goes here!</p>
<script>
    $("p").click(function () { 

        $.ajax({
          url: "status_2.html",       
          cache: false,
          success: fnSuccess
          }
        );
    });

   function fnSuccess(msg)
    {
        $('div#placeHolder').html(msg);
    }

function selectEditActivity(pass_id){   
    var row = $('#'+pass_id); 
    var seq = row.attr('seq');      
    // here I would like to pull the value of the date from the selected row
    // but I just can't get syntax right.  I get a null value on alert
    var from_date   = $('td', row).eq(0).html();  
    alert(from_date);
}
</script>

This is the html code that gets read in (file: status_2.html)

  <span id="status2"> 
  <span id="response" class="response"></span>

  <table class="tableBorder">
  <tr >
   <th class="align_left">Date</th>
  </tr><tr>

  <tr seq="1" class="row_theme2" id="id3014201105191"></tr>
    <tr><td>20090519</td>
    <td>1330</td>
  <td>1430</td>
  <td>LUNCH</td>  
   <td></td>
   <td><a onclick="selectEditActivity('id3014201105191');" href="#">EDIT</a></td>
 </tr>

  <tr seq="2" class="row_theme2" id="id3014201105192"></tr>
    <tr><td>20100519</td>
    <td>1330</td>
  <td>1430</td>
  <td>LUNCH</td>  
   <td></td>   
   <td><a onclick="selectEditActivity('id3014201105192');" href="#">EDIT</a></td>
 </tr>

  <tr seq="3" class="row_theme2" id="id3014201105193"></tr>
    <tr><td>20110519</td>
    <td>1330</td>
  <td>1430</td>
  <td>LUNCH</td>  
   <td></td>   
   <td><a onclick="selectEditActivity('id3014201105193');" href="#">EDIT</a></td>
 </tr>
</tbody></table>
  • 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-22T15:22:29+00:00Added an answer on May 22, 2026 at 3:22 pm

    Change this:

    var from_date = $('td', row).eq(0).html();  
    

    to this:

    var from_date = row.next().children('td').eq(0).html();
    

    …because the information you’re looking for is in the next row over from the one with the ID. The row with the ID has no <td> elements.

    Live Example: http://jsfiddle.net/kkP56/


    EDIT: You could get rid of the inline onclick handlers and let jQuery assign the handlers if you wanted.

    $(function() {
    
        $('table tr a').click(function() {
            var from_date = $(this).parent().prevAll().last().html();
            alert( from_date );
        });
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help from the shell-script gurus out there. I have a .txt
need some help from a regex jedi master: If I have a string of
Need some help. I have a table with some columns..like name , phone etc...
Need some help ! I have a ListActivity...on itch row i have 4 textVIew...
Need some help designing a bash script for grepping IP addresses from auth.log and
Ok need some help here. I have an autocomplete setup to pull from a
I need some help regarding algorithm for randomness. So Problem is. There are 50
I need some help calculating Pi. I am trying to write a python program
I need some help with jQuery script again :-) Just trying to play with
I need some help ... I'm a bit (read total) n00b when it comes

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.