1.<input type=submit >submit按钮
2.<input type=text>当form中只有一个文本本框按回车的时候
3.<input type=button onclick=javascript:form1.submit()>自己写脚本提交还有在js里的提交事件
2.<input type=text>当form中只有一个文本本框按回车的时候
3.<input type=button onclick=javascript:form1.submit()>自己写脚本提交还有在js里的提交事件
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<script language="javascript">
function aa(){ alert("aa")}
function ss(){ aa(); alert("ss");form1.submit()}
</script>
<body>
<form name="form1" method="post" action="#" onSubmit="aa()">
<input type="text" name="textfield">
<input type="submit" name="Submit" value="提交">
<input type="button" name="Submit2" value="按钮" onClick="ss()">
</form>
</body>
</html>
----
好外没冒泡啊
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312"/>
<link rel="stylesheet" href=".css"/>
<title>New Document</title>
<style type="text/css">
<!---->
</style>
<script type="text/javascript">
<!--function frmSub(frm){
alert("注意注意," + frm.id + " 要提交了");
}
window.onload = function(){
var frms = document.forms;
for(var i=0;i<frms.length;i++){
var existHandle = frms[i].onsubmit;
if(existHandle instanceof Function){
frms[i].onsubmit = function(){iwantdootherthing(); existHandle();};
}
}
}function iwantdootherthing(){
alert("嘿嘿,偷偷先干点事儿!");
}
//-->
</script>
<body>
<form id="frmData" method="post" action="" target="" onsubmit="frmSub(this)">
<input type="text" id="" name="">
<input type="submit" value="Submit">
</form>
</body>
</html>