Multiple submit Button click problem?

前端 未结 3 410
予麋鹿
予麋鹿 2020-12-22 01:56

I have a form which inserts data in DB on Submit button click but the problem is when client click the button multiple times its sends multiple create requests means multipl

3条回答
  •  死守一世寂寞
    2020-12-22 02:47

    Include a unique id in a field. Then on the server check if the request has already been processed.

    As an ID you can generate a GUID. Then you just need some structure to collect currently valid IDs. For example a Dictionary. Then from time to time you can clear old IDs out of the structure, and of course remove it when it is used.

提交回复
热议问题