提交表单禁用按钮
Multiple clicks on a "Submit" button can cause duplicate processing if your programming is slow or the user's connection is lagging. Duplicate processing can include duplicate database records, multiple emails, or different types of errors. JavaScript provides an easy way to disable the multiple submission of a form once the form has been submitted.
如果编程缓慢或用户连接滞后,则多次单击“提交”按钮可能导致重复处理。 重复处理可以包括重复的数据库记录,多封电子邮件或不同类型的错误。 一旦表单提交,JavaScript提供了一种简便的方法来禁用表单的多次提交。
代码 (The Code)
In the HTML, use the following "onsubmit" information:
在HTML中,使用以下“ onsubmit”信息:
It's important to trigger the even on form submission -- not everyone clicks the "submit" button. You will also need to give your submit button the submit_button ID attribute.
触发均匀表单提交很重要-并非每个人都单击 “提交”按钮。 您还需要为您的提交按钮提供commit_button ID属性。
提交表单禁用按钮