只能提交一次 限制 function submitonce(theform)

<script>

/*
Submit Once form validation-
?Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/
function submitonce(theform){
    //if IE 4+ or NS 6+
    if (document.all||document.getElementById){
        //screen thru every element in the form, and hunt down "submit" and "reset"
        for (I=0;I<theform.length;I++){
            var tempobj=theform.elements[I]
            if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset"){
                //disable em
                tempobj.disabled=true
            }
        }
    }
}
</script>

 

 

<FORM name=form2 onsubmit="submitonce(this);return false" action="" method=post>
    <INPUT name=textfield> <INPUT type=submit value=提交 name=Submit> <INPUT type=reset value=重设 name=Submit2> 提示:按下提交按钮后,看看有什么不同?
</FORM>

阅读更多
换一批

没有更多推荐了,返回首页