OK, so here's the easiest way to do this...
You've got a webpage with a form like below:
Code:
<form method="post" action="test.jsp" name="productForm">
<select name="skirts">
<option value="skirtA">SkirtA</option>
<option value="skirtB">SkirtB</option>
<option value="skirtC">SkirtC</option>
</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>
The onChange on the colour drop down should submit the form. You need to make sure that the "action" in the form tag points you the current JSP. So if the file with this code in is called test.jsp, the action should point to test.jsp.
Then at the top of this page somewhere you want some code similar to the following:
Code:
<%
// Retrieve the selected skirt & colour
String skirtType = request.getParameter("skirt");
String colour = request.getParameter("colour");
// Make sure these aren't null
if ((skirtType != null) && (colour != null)) {
// Form the SQL statement
String sql = "SELECT * FROM SKIRTS WHERE ";
sql += "SKIRT = "+ skirtType +" AND ";
sql += "COLOUR = "+ colour;
// Now you have a SQL statment containing the details of the
// selected skirt. Now use the sql variable to query the database.
// I'm afraid you'll have to figure out that bit yourself though ;)
}
%>
If you have any questions about the above code - post a reply here. I'll answer as soon as possible.