See the book 'Web Development with Java Server Pages' available from
www.manning.com/fields. He has the code you are looking for there. You can
download an PDF copy of the book for $13.50 USD and you can also download
the source files for the book from this URL.
Good luck.
Jerry M Denman
Senior Consultant
Management Information Consulting
-----Original Message-----
From: Chris Powell [mailto:[EMAIL PROTECTED]]
Sent: Thursday, May 04, 2000 2:03 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