<%@ page language="java" import="java.util.*" pageEncoding="GBK"%>
<html>
<head>
<title>main.jsp</title>
<script type="text/javascript">
function registor(){
document.getElementById("login").action="<%=request.getContextPath()%>/existAction.action";
document.getElementById("login").submit();}
function list(){
document.getElementById("login").action="<%=request.getContextPath()%>/listAction.action";
document.getElementById("login").submit();}
</script>
</head>
<body>
<center>
<h2><font color="red">注册</font></h2>
<form method="post" name="login" id="login">
用户名:<input type="text" name="username">
<input type="button" value="显示数据" οnclick="list()">//注意:onclick的方法千万不能喝form表单中定义的name和id重名,否则会报网页上有错
<input type="button" value="注册" οnclick="registor()">
</form>
</center>
</body>
</html>
struts中一个form表单实现多个按钮的提交
最新推荐文章于 2021-02-26 15:27:15 发布