javascript控制表单提交后,提交按钮不可用,防止用户多次提交
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>表单提交后按钮禁用</title> <script type="text/javascript"> function sub() { document.forms[0].elements[0].disabled = true; document.forms[0].submit(); } </script> </head> <body> <form action="login.action" method="post"> <input type="button" name="btn" value="提交表单" onclick="return sub();" /> </form> </body> </html>