Try something like

while (rs.next()) {
       int value = rs.getInt(1);
       String name = rs.getString(2);
       out.println("<option value=" + value + ">" + name);
}

to print out your <option> tags.

Then when the user selects something it is 'value' which is sent to the
server/servlet as a parameter. If there is no value attribute, by
default, then the 'name' is sent to the server/servlet. Note that you
cannot get both the value and the name sent to the server/servlet.

BTW this is basic HTML stuff and not really anything to do with
servlets.

--
Alan W. Smith
Bankgesellschaft, Berlin
Email:  [EMAIL PROTECTED]

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to