Ideally in the FORM tag if you give a method=POST the value of the form
element should get posted to the next page ..where you can use
request.getParameter(<the name of the form element>);

but if that doenst work you can use the onSubmit event in the FORM tag and
call a Javascript method where you will
set the value for th request explicity.
But i'd say the first one should work!

Vinod



                    Chris Powell
                    <[EMAIL PROTECTED]        To:     [EMAIL PROTECTED]
                    AU>                      cc:
                    Sent by: A               Subject:     Dropdown box selection
                    mailing list
                    about Java Server
                    Pages
                    specification and
                    reference
                    <JSP-INTEREST@JAV
                    A.SUN.COM>


                    05/04/00 11:33 AM
                    Please respond to
                    A mailing list
                    about Java Server
                    Pages
                    specification and
                    reference





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

Reply via email to