Gerald Staruiala wrote:
> I would read the list box via Javascript and pass it back to the servlet.
> I think that would be the path of least resistance.
No, the selected value of a drop-down menu is sent to the servlet as
a regular parameter with the name given to the SELECT tag. There's no
need to use JavaScript (I don't even see how that would help).
Example:
<SELECT NAME=foo>
<OPTION VALUE=1>A
<OPTION VALUE=2>B
</SELECT>
In the servlet get the selected value with
String value = request.getParameter("foo");
PS. Please do not send HTML formatted mails to this list. For many
they are hard to read and Reply in some readers doesn't automatically
quote the original text as it should when it's HTML. Your mail reader
should have an option where you can turn off HTML formatting.
>Yogesh Agarwal wrote:
>> Hi all,
>> I have a problem and I am stuck with it for quite sometime now. I am
>> using JDBC in servlets and I have a drop down menu where the options are
>> read from the database.
>> Now I want to read the selectedIndex from the drop down menu and use it
>> as a key to retrieve data from the tables. I am not able to figure out
>> how do I read the selectedIndex in a servlet. Any detailed help is
>> appreciated.
--
Hans Bergsten [EMAIL PROTECTED]
Gefion Software http://www.gefionsoftware.com
___________________________________________________________________________
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