<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>
表單提交後,提交按鈕不可用