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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:41:05+00:00 2026-06-15T09:41:05+00:00

I am trying to remove table row after successful ajax call, but it is

  • 0

I am trying to remove table row after successful ajax call, but it is not working. No errors in firebug, it deletes the row on the back-end PHP, just doesnt remove the tr. Here is my code:

function closelead(rowid){
            var rowid = rowid;

            $.ajax({
                type: "POST",
                url: "ajax/close.php",
                data: "rowid="+ rowid,

                success: function(html){

                    $(this).closest('tr').remove();
                }
            });

            }

and the html:

<table  id="companytable">
        <tr id="top"><th>Business Name</th><th>Phone</th><th>Carrier</th><th>X-Date</th><th></th><th></th><th></th></tr>
        <?php
        $query =   "SELECT * FROM leads WHERE user = '$user' ORDER BY wccompcode";
         $selectlead = mysql_query($query)or die(mysql_error());
         while($leadlist = mysql_fetch_array($selectlead)){
            $compcode = $leadlist['wccompcode'];
            $compcode = sprintf("%03s", $compcode);
            $selcomp = mysql_query("SELECT carname FROM carrierlist WHERE carcode = '$compcode'")or die(mysql_error());

            while($carrier = mysql_fetch_array($selcomp)){
                $carrier1 = $carrier['carname'];
            }
            ?>
            <tr id="<?php echo $leadlist['ID'];?>"><td id="busname"><?php echo $leadlist['busname'];?></td><td><?php echo $leadlist['phone'];?></td><td><?php echo $carrier1;?></td><td><?php echo date("m/d/Y",strtotime($leadlist['wcxdate']));?></td><td><input type="button" value="Call Back" class="searchbutton" /></td><td><input type="button" onclick="closelead(<?php echo $leadlist['ID'];?>)" value="Close" class="searchbutton" /></td><td><input type="button" value="Soft Quote" class="searchbutton" /></td></tr>
            <?
         }
        ?>
        </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-06-15T09:41:06+00:00Added an answer on June 15, 2026 at 9:41 am

    Try

    function closelead(rowid){
        var rowid = rowid;                
        $.ajax({
            type: "POST",
            url: "ajax/close.php",
            data: "rowid="+ rowid,                    
            success: function(html){                        
                $('#'+rowid).remove();
            }
        });                 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use jQuery to add dynamic Add/Remove row function, but I meet
I am trying to remove a row from one table and add it to
I'm trying to remove the HR tag from the last row in a table.
I'm trying to dedup a table, where I know there are 'close' (but not
I'm trying to remove a table row using jQuery, and while it disappears from
I'm trying to remove a table row (tr) from a table with a form
I'm trying to remove a row from a table when I click a specific
I'm trying to make this code delete a row from this table, but i
I face some problems when I am trying to remove rows from a table
I'm trying to make a trigger that will remove rows from one table based

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.