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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T12:24:53+00:00 2026-06-01T12:24:53+00:00

I am really confused about how I can do this. I need to get

  • 0

I am really confused about how I can do this. I need to get the value of two <td> when one is selected. For example, below let’s say I select the td with id=monthly of $550 dollars. I need to get the age and excess that corresponds with that price. I hope this makes sense. SO in the example of selecting $550 I need jQuery to get the values age(18-24) and excess($1000). I then will take these two values and insert into mysql as noted below. Is there anyway I can do this with either jQuery or PHP? I am open to ideas.

<table>
    <tr>
    <td width="67"></td>
    <td width="102" id="excess">$1000</td>
    <td width="102" id="excess">$2000</td>
    </tr>
    <tr>
    <td width="67" id="age">18-24</td>
    <td width="102" id="monthly">$550</td>
    <td width="102" id="monthly">$650</td>
    </tr>
    <tr>
    <td width="67" id="age">25-29</td>
    <td width="102" id="monthly">$750</td>
    <td width="102" id="monthly">$850</td>
    </tr>
    </table>

MYSQL(using the example above):

$query = mysql_query("UPDATE table SET Monthly = '$550' WHERE Age = '18-24' AND Excess = '$1000'")or die(mysql_error());
  • 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-01T12:24:54+00:00Added an answer on June 1, 2026 at 12:24 pm

    Your HTML is invalid. You cannot have more than one element with the same id, id values (as the name suggests) must be unique. If you’re trying to classify elements, use a class. The rest of this answer assumes those id values have been changed to class names.

    If I understand you, you want to handle clicks on cells with the monthly class and get the text of the first cell in the row along with the first cell in the column. This is easily done with jQuery (live example | source):

    $("td.monthly").click(function() {
        var $this = $(this),
            firstCellInRow = $this.closest('tr').find('td').first(),
            firstCellInColumn = $this.closest('table').find('tr').first().find('td').eq($this.index());
        console.log("First cell in row: " + firstCellInRow.text());
        console.log("First cell in column: " + firstCellInColumn.text());
    });
    

    We find the first cell in the row by finding the row via closest, then finding its first cell via find and first.

    We find the first cell in the column by finding the table via closest, then getting the first row via find and first, then getting the index of the clicked cell and finding the cell in the first row with the same index via eq.

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

Sidebar

Related Questions

I'm really confused about the visitor pattern and its uses. I can't really seem
I am really confused about object relationships! I have two classes Person and Address.
I'm at a point where I'm really confused about how to go about handling
I'm new to the entity framework and I'm really confused about how savechanges works.
I'm really confused - but really it's pretty wierd because I know two programming
I am confused about strings (a beginner's problem, I'm afraid): I have one NSMutableArray
I am really new to maven. I am bit confused about the dependency feature.
i'm a little confused about these two qualifiers... With ARC instead of using weak
So I'm getting really confused on how to do this whole thing and I
I read the msdn article about disposing objects in http://msdn.microsoft.com/en-us/library/ee557362(office.14).aspx now I'm really confused

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.