【发布时间】:2014-10-12 05:03:18
【问题描述】:
我正在尝试在下拉列表的 onchange 事件上导航到不同的 jsp 页面...
这是我的代码
<%@page import="java.util.*"%>
<html>
<head>
<title>Student Registration Form</title>
<style type="text/css">
h3{font-family: Calibri; font-size: 22pt; font-style: normal; font-weight: bold; color:SlateBlue;
text-align: center; text-decoration: underline }
table{font-family: Calibri; color:white; font-size: 11pt; font-style: normal;
text-align:; background-color: SlateBlue; border-collapse: collapse; border: 2px solid navy}
table.inner{border: 0px}
</style>
</head>
<body>
<h3>Select Product</h3>
<form action="retrieve_product" method="POST">
<table align="center" cellpadding = "10">
<tr>
<td>Select product to update</td>
<td>
<select name="category_list" onchange="Test.jsp">
<option>Option1</option>
<option>Option2</option>
</select>
</td>
</tr>
<!----- Submit and Reset ------------------------------------------------->
<tr>
<td colspan="2" align="center">
<input type="submit" name="UpdateProduct" value="Update">
<input type="reset" value="Reset">
</td>
</tr>
</table>
</form>
</body>
</html>
我为下拉列表尝试了所有事件 onclick、onchange、onfocus,但似乎没有任何效果。如果我使用了错误的事件,请建议我使用正确的事件来导航到不同的页面...... ..
【问题讨论】: