?
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
Medium Priority
?
226 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 640 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

770 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