1. 程式人生 > >jsp頁面 自動提交表單

jsp頁面 自動提交表單

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">

 <script type="text/javascript">
	function hello(){
		tanchu();
		$("submitForm").submit();
	}
	function tanchu(){
		alert("自動提交表單啊");
		$("submitForm").submit();
	}
 </script>

 </head>

 <body>
	<form action="www.baidu.com" method = "post" id = "submitForm" >
		<table>
			<tr>
				<td>
					<font size="3" color="red" >
						自動提交表單
					</font>
				</td>
			</tr>
		</table>
	</form>
	<script text="javascript">
		hello();
	</script>
 </body>

</html>
現在我寫的html是不好使的,我只是想通過這個例子,告訴大家,如果想自動提交表單的話,要在<body></body>裡的form後面加上你的javascript就可以