我是一个相当新的使用JavaScript,这是我到目前为止:
<!-- this is to disable the submit button and then re-enable it after 3 sec -->
<script type="text/javascript">
function enable()
{
var x = document.LAYOUTFORM.getElementById("create_button");
setTimeout(x.removeAttribute("disabled"), 3000);
}
</script>
Run Code Online (Sandbox Code Playgroud)
对于按钮我有这个:
<INPUT TYPE="SUBMIT" VALUE=" Create PDF " class="FORMBUTTON" ID="create_button" onclick="javascript:this.disabled=true;javascript:enable();">
Run Code Online (Sandbox Code Playgroud)
我已经搞砸了好几个小时,你们大多数人都会看着它,立即知道出了什么问题.我的表单ID和名称是LAYOUTFORM.谁能告诉我这里做错了什么?
对于奖励积分,我还希望按钮的文本在禁用时暂时更改为"正在创建...",然后再次返回到创建PDF.