Here's a bit of JS to disable all the buttons etc on a form.... function disablesubmit (forma) { for (var frm = 0; frm < document.forms.length; frm++) { for (var i = 0; i < document.forms[frm].elements.length; i++) { thisform = document.forms[frm]; thiselement = document.forms[frm].elements[i]; if (document.forms[frm].elements[i].type.toLowerCase() == 'button' || document.forms[frm].elements[i].type.toLowerCase() == 'submit' || document.forms[frm].elements[i].type.toLowerCase() == 'image'){ document.forms[frm].elements[i].disabled = true; } } } return; }
> -----Original Message----- > From: Simon McCaughey [mailto:[EMAIL PROTECTED] > Sent: 30 January 2004 10:26 > To: Struts Users Mailing List > Subject: Re: stop user from clicking the submit button twice > > > From: "Ashish Kulkarni" <[EMAIL PROTECTED]> > Sent: Thursday, January 29, 2004 10:30 PM > Subject: stop user from clicking the submit button twice > > Hi > > I have a process which takes about 30 seconds, i want > > to show some kind of image or disable the submit > > button untill the process is complete and tell user > > that the process is running > > How can i do it, i m using struts1.1 > > any code example or article will greatly help > > > > You could use some simple JavaScript to disable the button > once its been > clicked, or a simple JavaScript function to count the number > of clicks and > increment, if count!=1 then pop up an OK dialog saying "page > processing - > please wait". > > If you want to stay away from JS, you could set up your form submit to > redirect to a "processing please wait" type page, and then do > the actual > processing as a submission of that page. Should be fairly simple. > > HTH > > S. > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > ************************************** Axios Email Confidentiality Footer Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message, and notify us immediately. If you or your employer does not consent to Internet email messages of this kind, please advise us immediately. Opinions, conclusions and other information expressed in this message are not given or endorsed by my Company or employer unless otherwise indicated by an authorised representative independent of this message. WARNING: While Axios Systems Ltd takes steps to prevent computer viruses from being transmitted via electronic mail attachments we cannot guarantee that attachments do not contain computer virus code. You are therefore strongly advised to undertake anti virus checks prior to accessing the attachment to this electronic mail. Axios Systems Ltd grants no warranties regarding performance use or quality of any attachment and undertakes no liability for loss or damage howsoever caused. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]