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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:18:46+00:00 2026-06-14T23:18:46+00:00

may ajax append 2 same results on the table when i accidentally double click

  • 0

may ajax append 2 same results on the table when i accidentally double click on the button. is there a way to stop ajax from returning 2 or more result when i click the search button? i tried to abort the ajax but the result is the same. im just a newbie in ajax so help me guys

$("#btn_searchadmin").click(function(){

    var adminname = $("#tb_admin").val();
    var ajax;


    if(ajax){

      ajax.abort();
    }

     ajax = $.ajax({
                    type: "post",
                    url: "manage_deped_searchadmin.php",
                    dataType:'json',
                    cache:false,
                    data:{'adminname': adminname},


                    beforeSend: function(data){

                      $('#tbl_search').html('');


                    },

                    success: function(data){

                      $("#btn_searchadmin").bind('click');

                      $.each(data, function(i, item) {

                        $('#tbl_search').append("<tr><td>"+data[i].adminfname+"</td>  <td>"+data[i].adminlname+"</td>");

                      });
                    }
          });

  });
  • 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-14T23:18:48+00:00Added an answer on June 14, 2026 at 11:18 pm

    There are two basic approaches to this. I will give you a text answer rather than code.

    • Disable the button as soon as it is clicked, and re-enable it when the ajax has responded (eg in the complete handler);
    • Leave the button enabled but abort any unresolved previous ajax call resulting from an earlier click.

    Both of these approaches are valid and which you choose depends entirely on the application.

    • Choose approach 1 if a second ajax call must be disallowed until the first has completed.
    • Choose approach 2 if a second ajax call should be allowed to override an earlier one.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

May I know if there is any way to remove non-alphabetical symbols from a
Possible Duplicate: load content from external page into another page using ajax/query May be
May I know how could I pass the value of driver from code behind
May I know a way to change the Google Map marker color via Javascript..
As the title may suggest, I have been using jQuery AJAX to try and
i have a button that runs an ajax get which takes a long time.
I'm building a mobile web application that may or may not rely on ajax,
I'm using ajax to retrieve some data from the backend. I get the result
I'm using jQuery UI tabs, loading the tab content via ajax. Content may contain
I have a multiple language site. With html, javascript, may be ajax if an

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.