Oct 29, 2010, 5:43 AM
[CLOSED] avoiding the user from clicking the button more than once
hi..
in my application ,user enters data and clicks the button to save the data..if he clicks the button 3 times ,same records wiil be saved 3 times...
so to avoid this i have kept Event mask in butoon..
so to avoid this i kept java script function
please help me ... if the user clicks the button more than one time then the button should be disabled or is their any alternate ....please dont give suggestion to write code in .cs file
in my application ,user enters data and clicks the button to save the data..if he clicks the button 3 times ,same records wiil be saved 3 times...
so to avoid this i have kept Event mask in butoon..
<ext:ToolbarButton ID="btnDetailsSave" runat="server" Text="Save" Icon="Disk" >
<AjaxEvents>
<Click OnEvent="btnDetailsSave_Click" ViewStateMode="Include">
<EventMask Msg="saving..." ShowMask="true" />
</Click>
</AjaxEvents>
</ext:ToolbarButton>
whenever user clicks the button the evenmask will be displayed...but if he clicks the button more than once before event maskfiring, how much time he will click that many times the same record is saved...so to avoid this i kept java script function
<script language="javascript" type="text/javascript" >
var delay = function(millis) {
// var date = new Date();
// var curDate = null;
// do {
// curDate = new Date();
// }
// while (curDate - date < millis);
}
var Loading = function() {
Ext.getBody().mask("Saving Please Wait..", "x-mask-loading");
}
var executionJavascript = function() {
Loading();
setTimeout("delay(1000); Ext.getBody().unmask();", 1000);
}
</script>
<ext:ToolbarButton ID="btnDetailsSave" runat="server" Text="Save" Icon="Disk" OnClientClick="executionJavascript();" >
<%--<Listeners >
<Click Fn="executionJavascript" />
</Listeners>--%>
<AjaxEvents>
<Click OnEvent="btnDetailsSave_Click" ViewStateMode="Include">
</Click>
</AjaxEvents>
</ext:ToolbarButton>
but no use....please help me ... if the user clicks the button more than one time then the button should be disabled or is their any alternate ....please dont give suggestion to write code in .cs file
Last edited by Daniil; Nov 09, 2010 at 8:34 PM.
Reason: [CLOSED]