0
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form method="post" action="index.jsp" name="productForm">
</select> <select name="colour" onchange="document.productForm.submit()">
<option value="black">Black</option>
<option value="white">White</option>
<option value="brown">Brown</option>
</select>
<form>
<%
String colour = request.getParameter("colour");
out.println(colour);
%>
</body>
</html>
這我的源代碼時,我選擇的變化然後將它傳遞價值安慰和打印,但ONSELECT下拉值未設置將其設置爲第一個值請幫助我如何設置Obation的價值也如何選擇JSP中的設定值的onchange選擇的index.jsp的