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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:10:43+00:00 2026-05-26T18:10:43+00:00

I have a table being drilled out with PHP in a recorders. I am

  • 0

I have a table being drilled out with PHP in a recorders. I am using the table to update pricing. I have a text input and a form button. The button fires an Ajax call and updates the table. Right now I have the jQuery script inside the repeat region, but sometimes I have over 500 records.. Right now I use btn_2345 where 2345 is the unique I’d and the script fire on click btn_2345. How can I just use the script outside the repeat only once and get the values of the input text box and unique id.

  • 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-26T18:10:44+00:00Added an answer on May 26, 2026 at 6:10 pm

    If you have a table like this:

    <table>
        <tr>
            <td><input type="text"></td>
            <td><button>go</button></td>
        </tr>
        <tr>
            <td><input type="text"></td>
            <td><button>go</button></td>
        </tr>
        <!-- ... -->
    </table>
    

    Then you could add a data-id attribute to the rows, walk up the DOM from your <button> to the <tr> to get the ID, then go back down the DOM to find the <input>. The HTML would be sort of like this:

    <table>
        <tr data-id="11">
            <td><input type="text"></td>
            <td><button>go</button></td>
        </tr>
        <tr data-id="23">
            <td><input type="text"></td>
            <td><button>go</button></td>
        </tr>
        <!-- ... -->
    </table>
    

    And the JavaScript sort of like this:

    $('table button').click(function() {
        var $tr = $(this).closest('tr');
        var id  = $tr.data('id');
        var val = $tr.find('input[type=text]').val();
        // ...
    });
    

    You could also put the click handler in a named function if you like.

    You could make it even nicer by attaching a class to the <tr> elements and using that class with closest:

    <table>
        <tr data-id="11" class="one-chunk">
            <td><input type="text"></td>
            <!--...-->
    

    and

    $('table button').click(function() {
        var $chunk = $(this).closest('one-chunk');
        var id     = $chunk.data('id');
        var val    = $chunk.find('input[type=text]').val();
        //...
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL ISAM table being accessed my multiple php instances. Right now
I have this table where I can generate dynamic rows (which has input <type=text
I have a table being pulled from MySql through PHP.. The TD in the
I have table rows of data in html being filled from a CGI application.
I have a table with the only relevant column being completionDate, a number of
I have a table of 3-4 columns, the central one being task names that
I have an HTML table with one column being email addresses; spambot issues aside,
I have an html table containing values that are being generated from javascript. How
I have a MySQL table with about 5,000,000 rows that are being constantly updated
I have to add some enum options to a database table. The problem being,

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.