Why doesn't my form post when I disable the submit button to prevent double clicking?

后端 未结 10 1311
广开言路
广开言路 2020-12-31 19:06

Like every other web developer on the planet, I have an issue with users double clicking the submit button on my forms. My understanding is that the conventional way to han

10条回答
  •  天涯浪人
    2020-12-31 19:49

    document.getElementById('form1').onsubmit = function() {
        document.getElementById('btn').disabled = true;
    };
    

提交回复
热议问题