表单提交后,按钮自动禁用功能如何实现?
- 内容介绍
- 文章标签
- 相关推荐
本文共计132个文字,预计阅读时间需要1分钟。
表单提交后按钮禁用
<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.getElementByIdx_x('btn').disabled = true;//两种方法都可以实现禁用
document.forms[0].submit();
}
</script>
</head>
<body>
<form action="window1.html" method="post" target="_blank">
<input type="button" name="btn" value="提交表单" onclick="return sub();" />
</form>
</body>
本文共计132个文字,预计阅读时间需要1分钟。
表单提交后按钮禁用
<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.getElementByIdx_x('btn').disabled = true;//两种方法都可以实现禁用
document.forms[0].submit();
}
</script>
</head>
<body>
<form action="window1.html" method="post" target="_blank">
<input type="button" name="btn" value="提交表单" onclick="return sub();" />
</form>
</body>

