Solved

On click of a button how to disable button for 2 min and enabled it after 2 min.

Posted on 2012-04-03
5
220 Views
Last Modified: 2012-08-13
On click of a button how to disable button for 2 min and enabled it after 2 min.
0
Comment
Question by:Bharat Guru
  • 2
  • 2
5 Comments
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 37800472
Add a timer to your form. Set the Interval to 120000. Handle the Tick event of the timer. Within the Tick handler, re-enable the buttons. In your main button click, disable the other two buttons and start the timer.
0
 
LVL 9

Accepted Solution

by:
wasiftoor earned 160 total points
ID: 37800505
Simple Javascript should do the trick for you here. Please look at the code below:
_________________________________________________________________________________________
<input id="btn" type="button" value="click me" onclick="doSomething();"/>

<script>
function doSomething() {
  document.getElementById("btn").disabled=true;
  setTimeout('document.getElementById("btn").disabled=false;',60000);
  // do your heavy stuff here
}
</script>

Open in new window

0
 

Author Comment

by:Bharat Guru
ID: 37801600
if I add javascript function then my server side click function doesn't work.
can i see the sample where I can disable button only and continue the server side funtion call
0
 
LVL 9

Expert Comment

by:wasiftoor
ID: 37806037
patel: if you can post how you are making that call we might be able to help.
0
 

Author Closing Comment

by:Bharat Guru
ID: 37906107
Thanks
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now