How to avoid double insertion of two identical records when you double-click the submit button?

I have a popup that has two onclick methods: Submit and Cancel.

When I double-click submit , it inserts two entries that mean duplicate entries.

How can i avoid this?

0
source share
2 answers

Prevention of double sending is a common problem.

Despite the fact that there are many solutions since you marked it , two methods are provided by a ready-made framework for double-submit processing:

  • Token interceptor

    It returns a result invalid.token, which may, for example, display on an error:

    . , . , , "checkout" -. , : invalid.token, . , TokenSessionStoreInterceptor, , .

    . , token tag. , , . , ( ), .

  • Token Interceptor, , - , : submit , , ( ) (-):

    TokenInterceptor, . , . , , invalid.token , , , .

!

, , , , - , Javascript, .
, Firebug? , Javascript? (, ), , .

, , ... , , ( , ) - .

+6

, @Stefan, /mysql

, -

0

Source: https://habr.com/ru/post/1599061/


All Articles