1、javascript ,設置一個變量,只允許提交一次。
<script language="javascript">
??? var checkSubmitFlg = false;
??? function checkSubmit()
{
????? if (checkSubmitFlg == true)
?? {
???????? return false;
????? }
????? checkSubmitFlg = true;
????? return true;
?? }
?? document.ondblclick =
?? function docondblclick()
?? {
??? window.event.returnValue = false;
?? }
?? document.onclick =
?? function doconclick()
?? {
?????? if (checkSubmitFlg)
??? {
???????? window.event.returnValue = false;
?????? }
?? }
</script>
<html:form action="myAction.do"
method="post" onsubmit="return checkSubmit();">
2、javascript,將提交按鈕或者image置為disable<html:form action="myAction.do"
method="post"
??? onsubmit="getElById('submitInput')
.disabled = true;
return true;
">?
?
? <html:image
? styleId="submitInput"
? src="images/ok_b.gif"
? border="0" />
?
? </html:form>
posted on 2006-07-12 17:22
fish的Blog 閱讀(1716)
評論(0) 編輯 收藏 所屬分類:
JavaScript