The question you should ask yourself first is: What is the type of problem scenario you want to avoid?
- The user accidentally (or because of disappointment, ...) presses the button twice.
- A resource that is available only once (for example, reserving for a specific seat on an airplane) is consumed twice.
Don't just say "I want to avoid both." Even if you do, you will have to solve two problems separately.
Problem 1
This is best solved on the client side (for example, by disabling the button after pressing it).
( , , - ,...), . (, JavaScript, ), : 1 .
2
( ) . . , , ! ?
: . :
- . , ( 1).
... 3
- , :
, . -. . , , , .
, , , , , " ", " 1". , ..