How to Prevent Users from Submitting a Form Twice

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

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

16条回答
  •  臣服心动
    2020-12-01 07:39

    You can disable the button after clicking or hide it.

    
    

    js :

     function disableButton(button) {
         button.disabled = true;
         button.value = "submitting...."
         button.form.submit();
    }
    

提交回复
热议问题