<! doctype html> <html> <head> <meta http-equiv = "content-type" content = "text/html ؛ charset = utf-8"/> <title> 防止重复表单提交 </title> <style> #refresh {display: none ؛ العرض: 200 بكسل ؛ الارتفاع: 20 بكسل ؛ خلفية اللون: #ff0 ؛ } </style> <script> var inprocess = false ؛ window.onload = function () {document.forms ["picker"]. onSubmit = ValuadatesUbmit ؛ document.getElementById ("Refresh"). onClick = startOver ؛ } وظيفة التحقق من صحة () {// 防止重复的表单提交 if (inprocess) return ؛ Inprocess = صحيح ؛ console.log (Inprocess) ؛ document.getElementById ("submitbutton"). معطل = صحيح ؛ document.getElementById ("refresh"). style.display = "block" ؛ document.getElementById ("message"). innerhtml = "<p> 正在 المعالجة , 稍等 </p>" ؛ العودة كاذبة } وظيفة startOver () {inprocess = false ؛ document.getElementById ("submitbutton"). معطل = false ؛ document.getElementById ("message"). innerhtml = "" ؛ document.getElementById ("refresh"). style.display = "none" ؛ } < /script> </head> <body> <form id = "picker" method = "post" Action = ""> group1: <input type = "radio" name = "group1" value = "one" /> group2: <input type = "radio" name = "group1" value = "اثنين" /> group3: <إدخال نوع = "radio" type = "text" id = "intext"/> input 2: <input type = "text" id = "intext2"/> input 3: <input type = "text" id = "intext3"/> <input </html>