Preventing multiple submit clicks from going to the server...

Preventing multiple submit clicks from going to the server...

Post by Mariann » Fri, 14 Mar 2003 04:40:39


I would like to prevent a button from firing multiple events on the server
when the button is clicked multiple times.  The server processing is taking
some time, and users are getting impatient and resubmitting.

Adding an onclick attribute to specify a client script function worked fine,
but I still couldn't prevent the server submit event from happening.

Thanks, anyone...

 
 
 

Preventing multiple submit clicks from going to the server...

Post by Steve C. Orr, MCS » Fri, 14 Mar 2003 05:36:34


It sounds like you should consider using multithreading.
By running the long process on a separate thread, you free up the browser to
do other things, such as display the current status of the task.
That way the browser will respond immediately with a new page and can
entertain the user while they wait with an animation or status bar (and no
submit button.)
You can have the browser refresh a status bar or animation by putting an
HTML line like this in your code:
<META HTTP-EQUIV="refresh" CONTENT="3">
That will cause the browser to refresh every 3 seconds (and you can check
the status of the operation each time and redirect to a "done" page when
appropriate.)

Here's more details:
http://www.fawcette.com/vsm/2002_11/magazine/features/chester/

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net


Quote:> I would like to prevent a button from firing multiple events on the server
> when the button is clicked multiple times.  The server processing is
taking
> some time, and users are getting impatient and resubmitting.

> Adding an onclick attribute to specify a client script function worked
fine,
> but I still couldn't prevent the server submit event from happening.

> Thanks, anyone...


 
 
 

Preventing multiple submit clicks from going to the server...

Post by Andy Smit » Fri, 14 Mar 2003 05:37:24


I think the best solution i've seen so far is to use
Page.RegisterOnSubmitStatement to add this:
myButton.click = return false;

__
Andy Smith


Quote:> I would like to prevent a button from firing multiple events on the server
> when the button is clicked multiple times.  The server processing is
taking
> some time, and users are getting impatient and resubmitting.

> Adding an onclick attribute to specify a client script function worked
fine,
> but I still couldn't prevent the server submit event from happening.

> Thanks, anyone...

 
 
 

Preventing multiple submit clicks from going to the server...

Post by Kevin Spence » Fri, 14 Mar 2003 05:46:45


You could use JavaScript to disable the button after clicking it once.

HTH,

Kevin Spencer
Microsoft FrontPage MVP
Internet Developer
http://www.takempis.com
Different Strangs fer Different Thangs.


Quote:> I would like to prevent a button from firing multiple events on the server
> when the button is clicked multiple times.  The server processing is
taking
> some time, and users are getting impatient and resubmitting.

> Adding an onclick attribute to specify a client script function worked
fine,
> but I still couldn't prevent the server submit event from happening.

> Thanks, anyone...

 
 
 

1. Preventing Multiple Submit

We have a Web User Control that recreates itself every time the page loads.
There is a lot of processing in the Page Load event.  What is the easiest
way to prevent the user from clicking the Submit button multiple times
before the page load event is processed.  We insert a record in the database
when the user submits a valid form.  When users click the submit button more
than once, multiple records are added to the database.  Any help will be
greatly appreciated.  As you can tell, I'm a newbie in ASP.

Thanks.

Robert Ramos
Childrens's Oncology Group
Arcadia, California

2. Accounting

3. disable multiple clicks on submit / double submission

4. January 1999 issue of Acorn User

5. The form IS submitted (but not by clicking the submit button)

6. Help: Upgrading to minix386

7. Single client going to multiple servers of same type!!

8. ICA Client

9. How do I prevent a form from Submitting?

10. Disabling button to prevent double submits

11. How to prevent Web Form from default generating button with type=submit?

12. Prevent submit when hitting enter in a textbox

13. How to prevent a submit more than once