2012年3月29日星期四

Display 2 field of database in form <select>

I have a database "code" with 2 field : "product_code" and "description".
product_code | description
PC | Personal Computer
MS | Mouse
etc

The form will let user choose a product code from this database. The query is like this :

java.sql.ResultSet rsproduct = statement10.executeQuery("SELECT * FROM code ORDER BY product_code");

At the form section,

<select name="product_code">
<option value=""></option>
<%
while(rsproduct.next()){
%>
<option value="<%=rsproduct.getString("product_code").trim()%>"><%=rsproduct.getString("product_code")%></option>
<%}%>
</select>

How should I coding if wanna let user view the description for particular product_code while scroll down?

Thanks~~Can any code for "pop up" the different description while the mouse pointer is on the different product_code?

没有评论:

发表评论