---
title: "form表单提交的问题"
author: "hthjava"
date: "2009-06-25T09:32:24Z"
tags: []
slug: "form"
draft: false
lastmod: "2009-06-25T09:32:24Z"
id: 414754
url: "https://hthjava.iteye.com/blog/414754"
---

今天在页面上提交一个form表单，是这样写的

```java
<html>
	<head>
		<script type="text/javascript">
			function a(){
				alert("access");
				document.test.submit();
			}
		</script>
	</head>

	<body>
		<form name="test" action="bbb.html" method="post">
			<input type="button" name="submit" onClick="a();" value="提交"/>
		</form>
	</body>
</html>
```

一提交就报js错误，说document.test.submit()不是函数，奇怪了，到网上查了下，原来<input type="button" name="submit" onClick="a();" value="提交"/>这个地方的name不能为submit,随便换一个好了，猜想submit可能被html内置了，所以冲突，处错误