Jump to content
Larry Ullman's Book Forums

Change Specific Html Table Row By Jquery.ajax

Recommended Posts

I have an HTML table generated by PHP querying from MySQL table.

          <th>Article Name</th>
          <th>Publish Status</th>
          $i = 1;
          foreach ($obj->showAllFromTable('pattern') as $pattern) {
          <td><?php echo $i++; ?></td>
          <td><?php echo $id; ?></td>
          <td><?php echo $pattern_name; ?></td>
          <td id="publish_<?php echo $id; ?>" class="status_pattern">
             <?php echo $publish; ?>

I want to change the status of any article by clicking on the 'publish' cell of the corresponding article row. I am trying to use ajax method of jquery for this purpose as shown in the following:

    <script type="text/javascript">
        var thisid = $(this).attr('id');
            url: "status_change_pattern.php",
            data: {
                id: thisid
            success: function (response) {
In the "success" block, instead of "alert", I want to create a functionality to change the text of the specific cell which I clicked. The "status_change_pattern.php" has just a text "Hey Hey".
Can anyone help? Please.

Link to post
Share on other sites

Hey Hartley San, I'm sure you don't remember me. But you were my savior in the past...

Thanks for your kind response.

I have found the following to be a perfect solution:


Got the above from forum.jquery.com.

Thanks again.

  • Upvote 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...