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
224 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 75

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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Generate Unique ID in VB.NET 21 105
ASP.NET MVC -Update model when click on <li> element 29 70
c#, case, if 4 22
Validation for Passport expiry in asp.net 2 17
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

730 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