提交一次后按钮变灰,防止重复提交表单
<script>
vari=0;
functionformCheck(){i++;if(i>1){document.form.submit1.disabled=true;}returntrue;}
functionpresskey(eventobject){if(event.ctrlKey&&window.event.keyCode==13){i++;if(i>1){alert('帖子正在发出,请耐心等待!');returnfalse;}this.document.form.submit();document.form.submit1.disabled=true;}}
</script>
支持CTRL+ENTER提交。只能提交一次。
<formname="form"method="post"action=''οnsubmit="returnformCheck()">
<TEXTAREAname=contentrows=6cols=79οnkeydοwn=presskey()></TEXTAREA><BR><INPUTtabIndex=4type=submitvalue="Ctrl+Enter回复主题"name=submit1οnclick="returnformCheck()"> <INPUTtype=resetvalue="重写主题"name=resetοnclick="checkclick('该项操作要清除全部的内容,您确定要清除吗?')"></form>
========================
<script>
functiondisable()
{
document.form1.Submit.disabled=true;
}
</script>
<formname="form1"method="post"action=""οnsubmit="disable()">
<p>
<inputtype="submit"name="Submit"value="提交"
</p>
</form>
http://www.corange.cn/archives/2008/03/377.html
<script>
vari=0;
functionformCheck(){i++;if(i>1){document.form.submit1.disabled=true;}returntrue;}
functionpresskey(eventobject){if(event.ctrlKey&&window.event.keyCode==13){i++;if(i>1){alert('帖子正在发出,请耐心等待!');returnfalse;}this.document.form.submit();document.form.submit1.disabled=true;}}
</script>
支持CTRL+ENTER提交。只能提交一次。
<formname="form"method="post"action=''οnsubmit="returnformCheck()">
<TEXTAREAname=contentrows=6cols=79οnkeydοwn=presskey()></TEXTAREA><BR><INPUTtabIndex=4type=submitvalue="Ctrl+Enter回复主题"name=submit1οnclick="returnformCheck()"> <INPUTtype=resetvalue="重写主题"name=resetοnclick="checkclick('该项操作要清除全部的内容,您确定要清除吗?')"></form>
========================
<script>
functiondisable()
{
document.form1.Submit.disabled=true;
}
</script>
<formname="form1"method="post"action=""οnsubmit="disable()">
<p>
<inputtype="submit"name="Submit"value="提交"
</p>
</form>
http://www.corange.cn/archives/2008/03/377.html