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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:34:57+00:00 2026-05-27T15:34:57+00:00

hi guys even i have success delete the message return false delete message(could not

  • 0

hi guys even i have success delete the message return false delete message(“could not delete”) besides success delete messege but query is wokrking
please tell me what i am doing wrong here is my codes \

delete.php

  if(isset($_POST['delete_id']) && !empty($_POST['delete_id'])) {
          $delete_id = mysql_real_escape_string($_POST['delete_id']);
    $query=mysql_query("DELETE FROM color WHERE idColor='$delete_id'");
    if($query != false) {
            echo 'true';
          }
    mysql_close();
<script>
 $(document).ready(function(){
        $('.del_btn').click(function(){
        if (confirm("Are you sure you want to delete this Color?"))
       var del_id = $(this).attr('rel');
              $.post('script/delete_color.php', {delete_id:del_id}, function(data) {
          if(data == 'true') {
            $('#'+del_id).remove();alert('Color has been deleted!');
          }
           else {
            alert('Color could not delete!');
          }
                document.messages.submit();
            return false; // This line added}
    });
    }); 
    });

</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-05-27T15:34:58+00:00Added an answer on May 27, 2026 at 3:34 pm

    I didn’t really understand your problem, but I’m going to take an educated guess…

    You need to wrap your logic inside the “confirm” IF statement. Also, you had an extra “});”.

    $(document).ready(function(){
    
        $('.del_btn').click(function() {
    
            if (confirm("Are you sure you want to delete this Color?")) {
    
                var del_id = $(this).attr('rel');
    
                $.post('script/delete_color.php', {delete_id:del_id}, function(data) {
    
                    if(data == 'true') {
                        $('#'+del_id).remove();alert('Color has been deleted!');
                    } else {
                        alert('Color could not delete!');
                    }
    
                    document.messages.submit();
                    return false; // This line added
                }
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I have a google apps account set up and even set up
It seems that C# 3 hit me without me even noticing, could you guys
Hey guys, I have a search field that is not submitting when the enter
This might not be relevant to this site, but hopefully you guys can point
Hey guys, I've been trying to play with mongoose & node, but I have
I have been using with success, grand central dispatch in my apps, but I
Guys, I’ve been writing code for 15+ years, but managed to avoid Web Development
guys i have arrays in which i have to match this kind of text
Hey guys I have a ruby on rails app with a before filter setup
hey guys i have written a small webservice which allows users of a company

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.