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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:42:26+00:00 2026-05-23T13:42:26+00:00

I have a few buttons on a page, which when clicked, trigger an ajax

  • 0

I have a few buttons on a page, which when clicked, trigger an ajax call, which then accesses the DB.
After a click, I want the user to not be able to click any of the buttons until the ajax call responses.
But, if possible, I’d like the user to get some indication that the system is in proccess so he won’t think it’s stuck.
Some sort of a simple animation and graying out the page can do the trick, until there’s a response.

Also, I’d like to set a time limit on the ajax call so if there’s no response for, say, 10 seconds, the call will return and give an error message.

What are my options?

I’m working under WordPress, so if it has some nice way to deal with this that’s also an option.

  • 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-23T13:42:26+00:00Added an answer on May 23, 2026 at 1:42 pm

    this should do it

    js

    $('#overlay').show();
    
    $.ajax({
       url: 'somepage.htm',
       timeout: 10000, /*milliseconds*/
       })
      .complete(function(){ $('#overlay').hide(); }) /*runs after success or error*/
      .success(function(data){ /*do whatever*/ })
      .error(function(){ /*timeout or general error*/ });
    

    html

    <div id="overlay"></div>
    

    css

    #overlay{
      display:none;
      position:fixed;
      top:0;
      left:0;
      right:0;
      bottom:0;
      background-color:#666;
      opacity:0.6;
      z-index:999;
    }
    

    demo at http://jsfiddle.net/gaby/X6sDS/1/

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

Sidebar

Related Questions

I want my users to have the ability to choose a few buttons which
I have form with few buttons and I want to know what button is
I have a form with a few buttons which execute code when pressed like
I want to realize app which will have few slides. How to do it
I have got a html web page which gets a user input in the
I have a grid which shows product versions and have a few link buttons
In my ASP.Net page, i have a few link button controls which are placed
I have a simple aspx page with a few TextBoxes and a submit button.
HI I have a form with a few buttons. Each button runs a few
I have a few text boxes and buttons on my form. Lets say txtBox1

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.