Manish,
It didn't work. I am copying the header section from my page here -
maybe I am missing something
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD> <TITLE></TITLE>
<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<script language="JavaS cript">history. forward();
function ignoreinput()
{return false;}
function stop_input()
{
window.attachEv ent("onkeydown" , ignoreinput);
window.attachEv ent("onclick", ignoreinput);
}
</script>
</HEAD>
<BODY LEFTMARGIN=0 TOPMARGIN=0 BOTTOMMARGIN=0 RIGHTMARGIN=0
onLoad='javascr ipt:setDefaultB uttonScript()'>
<form name="_ctl16" method="post" action="MyPage. aspx"
language="javas cript" onsubmit="retur n stop_input();" id="_ctl16"
runat="server">
I have two buttons on this page, print and cancel. Print takes about
10 seconds to print the report and cancel just take you back to the
previous page. If I click on print and after two seconds, click on
cancel then it takes me back to the previous page. What I want is that
once user clicks on print, all the other controls should be disabled
(or ignored).
I haven't looked at the other examples on the link - if this doesn't
work then I will look into that.
thanks
Manish Bafna wrote:
Hi,
Actually following sentence in your code needs to be corrected:
InCorrect :<form id="Form1" method="post" runat="server"
onsubmit="stop_ input();">
Correct One : <form id="Form1" method="post" runat="server" onsubmit="retur n
stop_input();">
Anyway two solutions provided in the following URL will surely solve your
probelm:
http://www.codersource.net/published...rocessing.aspx.
Thanks and regards,
manish bafna
"Sehboo" wrote:
We want to prevent user from being able to click on a button twice or
click on other controls while processing is going on. I tried the
following javascript code (which was suggested in this group but it
didn't really work). User can click on "print" button and then before
postback, they can click on "cancel" button. Any other suggestions?
function ignoreinput() (
return false;
}
function stop_input() {
window.attachEv ent(""onkeydown "", ignoreinput); " _
window.attachEv ent(""onclick"" , ignoreinput); " _
}
Then in the form element of the page add an onsubmit entry..
<form id="Form1" method="post" runat="server" onsubmit="stop_ input();">