熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Javascript >> 正文

JS防止用戶多次提交

2022-06-13   來源: Javascript 

  <html> <head> <meta httpequiv="ContentType" content="text/html; charset=utf" /> <title>表單提交後按鈕禁用</title> <script type="text/javascript"> function sub() { documentforms[]elements[]disabled = true; documentforms[]submit(); } </script> </head> <body> <form action="loginaction" method="post"> <input type="button" name="btn" value="提交表單" onclick="return sub();" /> </form> </body> </html>

  表單提交後提交按鈕不可用


From:http://tw.wingwit.com/Article/program/Java/Javascript/201311/25495.html
    推薦文章
    Copyright © 2005-2022 電腦知識網 Computer Knowledge   All rights reserved.