Disable submit button ONLY after submit

前端 未结 13 625
囚心锁ツ
囚心锁ツ 2020-12-02 22:49

I have the following HTML and jquery:






Test disabling submit button fo

13条回答
  •  情深已故
    2020-12-02 23:29

    Test with a setTimeout, that worked for me and I could submit my form, refers to this answer https://stackoverflow.com/a/779785/5510314

    $(document).ready(function () {
        $("#btnSubmit").click(function () {
            setTimeout(function () { disableButton(); }, 0);
        });
    
        function disableButton() {
            $("#btnSubmit").prop('disabled', true);
        }
    });
    

提交回复
热议问题