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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:50:42+00:00 2026-05-27T04:50:42+00:00

First Problem: When user deleted particular row then i have to remove that row

  • 0

First Problem:

When user deleted particular row then i have to remove that row only with out page refresh.
Deleting row using ajax. How can i do this

Second Problem:
Actually i am calculating the when ever page hits from that day to previous 7 days.
But i want when page hits today i have to retrieve previous week
Means from sunday(20 Nov 2011) to saturday (20 Nov 2011)
When page hits on next monday so i have to retrieve this week records
Means from sunday(27 Nov 2011) to saturday (03 Dec 2011)

function authenticate(){
$.ajax({
type: "POST",
url: "authentication.php",                 
data: $("#login_form").serialize(),
success: function(msg){
    if(msg==1){
    $('#delete').html("success"); //if success message appear only i have to remove particular row
    }) 
    }else{
    $('#delete').html("error");
    }
},
error:function(msg){
    alert(msg);
    $('#delete').dialog("close"); 
}              
});
}
<div style='display: none;' id='delete'></div>
<table border="1">
<tr>
    <th>Title</th>
    <th>Public Id</th>
    <th>Pass</th>
    <th></th>
</tr>
<?php
$select = $db->select ()
    ->from ( 'test', '*' )
    ->where ( 'user_id = ?', 1 )
    ->where ( 'test.created > DATE_SUB(CURDATE(), INTERVAL 7 DAY)' );
$tourDetails = $db->fetchAll ( $select );
$i = 0;
foreach ( $tourDetails as $row1 ) {
    $i ++;
    $title = $row1 ['title'];
    $PublicId = $row1 ['public_id'];
    if (($i % 2) == 0 ) {
        $rowResponse =  prepareRow ( true, $title, $PublicId);
        echo $rowResponse;
    } else {
        $rowResponse = prepareRow ( false, $title, $PublicId);
        echo $rowResponse;
    }
}
function prepareRow($flag, $title, $PublicId) {
$rowResponse = "";
if ($flag) {
    $rowResponse .= '<tr class="even">';
} else {
    $rowResponse .= '<tr class="odd" >';
}
    $rowResponse .= '   
    <td> ' . $title . ' </td>
    <td> ' . $publicId . ' </td>
    <td><p><a onclick=openDialog("'. $PublicId .'","delete") href="#" id="dialog_link"> 
    Delete </a></p>
    </td>';
return $rowResponse;
?>
</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-05-27T04:50:43+00:00Added an answer on May 27, 2026 at 4:50 am

    You can use jQuery’s nth-child selector.

    $("table#mytableid tr:nth-child(2)").remove();
    

    This will remove the second row, for example. Make sure your table has an ID or a class so that you select it more easily (not accidentally removing 2nd row of EVERY table on the page, in case you have more)…

    EDIT

    From what I see in your code, you could select the parent tr element from your onclick event and then either send it to the function as a new parameter (which you would remove it the ajax returns success) or remove it right away… or whatever you want.

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

Sidebar

Related Questions

Currently developing a PHP framework and have ran into my first problem. I need
We have a couple of mirrored SQL Server databases. My first problem - the
It might sound unnecessary, but let me explain my problem first. Probably then it
I have a problem but first i want to know if im working on
I have this query that gets executed though Linq to Entities. First time the
My problem is that I am adding a row to a HTML table dynamically
The problem I'm having is that a Vehicle object is not being deleted from
first, a little background. I am using VS2010 and have a WCF service that
First time cake user and I'm having real apache problems. For some reason the
UPDATE: First problem solved, second one described at the bottom of this post. UPDATE2:

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.