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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:45:54+00:00 2026-06-17T08:45:54+00:00

I have a generated table which i need when press button on 6th column

  • 0

I have a generated table which i need when press button on 6th column to get 1st cell value in the row and send it to an overlay page, the overlay page will do some calculations which will take some time and show a score, i want to replace the 6th column button with that score.

I cant get page2.php to show in the over lay while processing (i use popup from here)

here is what i reached so far

<tbody>
    <?php foreach ($rows as $row_number => $columns): ?>
      <?php
        $row_class = 'row-' . ($row_number + 1);
        if ($row_number == 0) {
          $row_class .= ' row-first';
        }
        if (count($rows) == ($row_number + 1)) {
          $row_class .= ' row-last';
        }
      ?>
      <tr class="<?php print $row_class; ?>">
        <?php foreach ($columns as $column_number => $item): ?>
          <td class="<?php print 'col-'. ($column_number + 1); ?>"  >
                <?php print $item; ?>
          </td>
        <?php endforeach; ?>
<td>
<?php print $dnsearch; ?> 
</td>
<td>

<button id="my-button">Get Score</button>
<div id="element_to_pop_up">
    <a class="bClose">x<a/>

here should page2.php receive the variable from script and do the processing and return data (score) to replace the clicked button

 </div>



    </td>
          </tr>
        <?php endforeach; ?>
      </tbody>
    </table>


    <script type="text/javascript">
    $(":button").click(function (e) {
    e.preventDefault();
    $('#element_to_pop_up').bPopup();
    $.post("page2.php", {val: $(this).closest('tr').find('td:eq(0)').text()}, function(returned_data){
    //    alert(returned_data); 
          $(e.target).closest("td").text(returned_data); // to replace button with score
       });

    });

    </script>
  • 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-17T08:45:55+00:00Added an answer on June 17, 2026 at 8:45 am

    on click of the button send the value of the first row to jquery and make a ajax call to second page and do the required calculations when ever by response of second page replace the button with result look for examples.

    http://api.jquery.com/jQuery.ajax/

    put your button in a span like this

    <span id="result">
    <button id="my-button">Get Score</button></span>
    

    then in your response handling jquery put this

    $("#result").html(you calculation result jquery variable);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DB table in which each row has a randomly generated primary
I have the following html structure (which is generated and I can't change): <table
I have a dynamically generated table and for each row in the table there
I have a table, with rows which all have a cell of a div
Have a linking (or ref) table which has a dual primary key. Need to
I have html table which was generated from server side : DataTable dt2 =
I have a asp.net Generated table that creates a table which is slide show
I have the following need I have a logging table which logs som leads
I have a course table which I need to search based on keywords typed
Fiddle: http://jsfiddle.net/MhWm5/16/ I have some dynamically generated table rows/values with dynamic IDs <td class=control-group>

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.