Curious about submit buttons on Server pages

  • Thread starter David Alexander
  • Start date
D

David Alexander

I see a lot of websites where you press a submit button to place an order.
Typically, this involves credit card data in a form being submitted, passed
to some third-party validator, bank, etc. and the result coming back to the
server, then back to the client. Very often, they warn, "Don't press submit
more than once or you may be billed twice."

Perhaps I am being naive, but why don't the page designers just use
JavaScript to deactivate the button after it has been pressed? Is there a
problem tying JavaScript and Server Control events to the same control?

I just can't believe that this situation can't be handled by the software,
rather than begging the user not to misbehave. I am most familiar with
ASP.NET. I would think that you could specify, serverside, that the onclick
event for the button could fire the client event first, then the JavaScript
even that ASP.NET uses to submit the form second.

I need to do something similar for a big transaction that isn't financial,
but requires a lot of data chewing and I want the user to be unable to
double-submit. Is there something flawed with deactivating the button until
the server responds?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top