| | |
ASP.NET Timer Button
Please support our ASP.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
easiest way is javascript
ASP.NET Syntax (Toggle Plain Text)
<html> <head> <script language="JavaScript"> <!-- function setDisableButtonTimer(){ disableButtonTimer = setInterval("disableButton()", 5000); } function disableButton(){ document.form1.btnSubmit.disabled = true; clearInterval(disableButtonTimer); } --> </script> </head> <body onload="setDisableButtonTimer();"> <FORM ACTION="test.asp" METHOD="POST" name="form1" > <SELECT NAME="MyListBox" Size="11" MULTIPLE> <OPTION VALUE="0">CustomerID <OPTION VALUE="1">CompanyName <OPTION VALUE="2">ContactName <OPTION VALUE="3">ContactTitle <OPTION VALUE="4">Address <OPTION VALUE="5">City <OPTION VALUE="6">Region <OPTION VALUE="7">PostalCode <OPTION VALUE="8">Country <OPTION VALUE="9">Phone <OPTION VALUE="10">Fax </SELECT><P> <INPUT TYPE=submit name="btnSubmit" >   <INPUT TYPE=reset> </FORM> </body> </html>
•
•
Join Date: Jun 2005
Posts: 50
Reputation:
Solved Threads: 0
<!--
function setDisableButtonTimer(){
disableButtonTimer = setInterval("disableButton()", 5000);
}
function disableButton(){
document.form1.btnSubmit.disabled = true;
clearInterval(disableButtonTimer);
}
-->
</script>
</head>
<body onload="setDisableButtonTimer();">Campkev, are the above the essential parts i need to have in the html page? Also how do i run the script for the ASP.NET web control button since i have to call 2 functions?
•
•
Join Date: Jul 2005
Posts: 483
Reputation:
Solved Threads: 19
here is a whole web page to give you the idea
ASP.NET Syntax (Toggle Plain Text)
<html> <head> <script language="JavaScript"> <!-- function setDisableButtonTimer(){ disableButtonTimer = setInterval("disableButton()", 5000); } function disableButton(){ document.form1.btnSubmit.disabled = true; clearInterval(disableButtonTimer); } --> </script> </head> <body onload="setDisableButtonTimer();"> <FORM ACTION="test.asp" METHOD="POST" name="form1" > <SELECT NAME="MyListBox" Size="11" MULTIPLE> <OPTION VALUE="0">CustomerID <OPTION VALUE="1">CompanyName <OPTION VALUE="2">ContactName <OPTION VALUE="3">ContactTitle <OPTION VALUE="4">Address <OPTION VALUE="5">City <OPTION VALUE="6">Region <OPTION VALUE="7">PostalCode <OPTION VALUE="8">Country <OPTION VALUE="9">Phone <OPTION VALUE="10">Fax </SELECT><P> <INPUT TYPE=submit name="btnSubmit" >   <INPUT TYPE=reset> </FORM> </body> </html>
Last edited by campkev; Feb 6th, 2006 at 11:05 am. Reason: added code tags
![]() |
Similar Threads
- ASP.Net timer control (ASP.NET)
- ASP.NET button backcolor changing from code. (ASP.NET)
- C#ASP.Net: how to browse the folder list on Server? (C#)
Other Threads in the ASP.NET Forum
- Previous Thread: Disable ASP.NET Button from Listbox
- Next Thread: Reading CSV file into a ADO recordset
| Thread Tools | Search this Thread |
.net 2.0 3.5 activexcontrol advice ajax appliances asp asp.net bc30451 beginner bottomasp.net browser businesslogiclayer button c# c#gridviewcolumn cac checkbox class click commonfunctions compatible confirmationcodegeneration content contenttype control countryselector courier css database datagrid datagridview datagridviewcheckbox datalist deadlock deployment development dgv dialog dropdownmenu dynamic edit embeddingactivexcontrol expose findcontrol flash flv formatdecimal forms formview gridview homeedition iframe iis javascript jquery list menu mono mssql multistepregistration nameisnotdeclared novell objects order problem ratings rotatepage save search security serializesmo.table sessionvariables silverlight smartcard sql sqlserver2005 ssl suse textbox tracking treeview unauthorized validatedate validation vb.net video virtualdirectory vista visual-studio visualstudio vs2008 web webarchitecture webdevelopemnt webdevelopment wizard xml youareanotmemberofthedebuggerusers





