How to Prevent Users from Submitting a Form Twice

后端 未结 16 1018
挽巷
挽巷 2020-12-01 06:59

when user click add button twice, from get submitted twice with same dat

16条回答
  •  一个人的身影
    2020-12-01 07:32

    You could notify the user that he drinks too much coffee but the best is to disabled the button with javascript, for example like so:

    $("#btnADD").on('click', function(btn) {
      btn.disabled = true;
    });
    

提交回复
热议问题