If you just need to display the value why don't you use the request object o
directly access the form elements and retrieve the value of the select? Are
you POSTing the form or GETing the form? If you are GETing the form the
query string can be used to get the value too.
- V.M.
If it is to be, it is upto me.
> -----Original Message-----
> From: Chris Powell [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, May 04, 2000 11:33 AM
> To: [EMAIL PROTECTED]
> Subject: Dropdown box selection
>
> Can any one help?
> I have a JSP which has a dynamically built dropdown list box,
> when selecting from the list I call another JSP page but
> I need to remember what I have selected and display it on my new page.
> What would be the best way of doing this?
>
> see code below:-
> *******************************
> <form name="form" action="enquiry_page2.jsp">
> <select name="site" size=1 onChange="window.document.form.submit()">
>
> <%
> String[] ids = mybean.getInstallids();
> String[] desc = mybean.getInstalldesc();
> for (int i=0; i< ids.length; i++){
> if (i != ids.length)
> out.print("<option value='" + i + "'>" + ids[i] + " - " +
> desc[i] + "</option>");
> else
> out.println(" " + ids[i]);
> }
> %>
> </select>
> </form>
> *********************************
>
> Note I can see the index of the item I have selected but I don.t think I
> should need to
> extract it from the URL and then do a get from 'mybean' there must be a
> better way.
>
> Any help would be useful.
>
> Thanks in Advance
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
> http://java.sun.com/products/jsp/faq.html
> http://www.esperanto.org.nz/jsp/jspfaq.html
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets