这是我的代码,但是不跳转,各位帮忙看看
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'reg.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<center>
用户注册<br>
<hr>
<form action="" method="post" onsubmit="direction(this);">
请选择用户类型:
<input type="radio" value="1" name="redio1" checked>普通用户
<input type="radio" value="2" name="redio2">管理员
<hr>
请输入用户名:<input type="text" name="username">
<input type="submit" value="下一步">
</form>
<script type="text/javascript">
function direction(myform){
if(myform.number[1].checked){
form.action="regUser.jsp";
}
if(myform.number[2].checked){
form.action="";
}
}
</script>
</center>
</body>
</html>
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'reg.jsp' starting page</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
--> </head>
<body>
<center>
用户注册<br>
<hr>
<form action="" method="post" onsubmit="direction(this);">
请选择用户类型:
<input type="radio" value="1" name="redio1" checked>普通用户
<input type="radio" value="2" name="redio2">管理员
<hr>
请输入用户名:<input type="text" name="username">
<input type="submit" value="下一步">
</form>
<script type="text/javascript">
function direction(myform){
if(myform.number[1].checked){
form.action="regUser.jsp";
}
if(myform.number[2].checked){
form.action="";
}
}
</script>
</center>
</body>
</html>
解决方案 »
- 怎么解决default-action-ref和*_*的冲突
- 用数组便利LIST的问题
- 请问Hibernate中这两条语句是否相等???
- 菜鸟求助 关于Oracle中 sequence 的问题
- 初学者求教tomcat5配置jsp运行环境问题(50分)
- IIS与Tomcat的整和,哪位高手帮帮小弟,谢谢!!
- TOMCAT 如何在什么地方配置SESSION 失效时间?
- 诚招,急招软件工程师1名,月低薪10000
- 问一个菜问题,请大家相助,谢谢!
- jbuilder8连接weblogic7当时编译一个简单的web程序时提示找不到weblogic-sp.jar
- jxl读取excel抛jxl.read.biff.BiffException: Unable to recognize OLE stream
- 关于接口方法的实现问题
<form action="" method="post" onsubmit="direction(this);">
请选择用户类型:
<input type="radio" value="1" name="redio1" checked>普通用户
<input type="radio" value="2" name="redio2">管理员
<hr>
请输入用户名:<input type="text" name="username">
<input type="submit" value="下一步">