标签:
转自:http://blog.sina.com.cn/s/blog_9b9a08c701017dz6.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<script language="JavaScript">
function act1()
{
document.testForm.action="a.jsp"; //testForm为form表单的name
document.testForm.submit();
}
function act2()
{
document.testForm.action="b.jsp";
document.testForm.submit();
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<form name="testForm" method="post" action=""> //action为""
<input name="Name" type="text" id="Name">
<input type="button" name="Button" value="Act1" onClick="act1();">
//onClick的函数名不能与name相同,此处name="Button"不能写成name="act1()"
<input type="button" name="Submit2" value="Act2" onClick="act2();">
</form>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/gugibv/p/4857678.html