Vineet
There seems to be a little confusion about your question. As I understand
it, you have a jsp/Servlet that either needs to read a form for dynamically
created entries of a list OR needs to read a request for selected items from
the list.
Since this is a java based server-side programming group, I'll ignore
JavaScript solutions -- From what I understand of your question, pure Java
can handle your needs, all from the server, eliminating obvious JavaScript
problems. Two answers:
1. Others have proposed request.getParameter. You will need to parse the
request.getParameter string for individual selected values --
request.getParameter("listvarname") returns all selected items in this
format: "item1,item2,...,itemN."
I don't think you are asking this, though... so here is another answer:
2. If you asking how to get all the possible items of a form list
(myform.mycombo), from which a client may select, you will need to read and
parse the form... not the request.
If the form is created by code within your control, there may be (probably
is) a better solution to this problem, but your description implies that you
do not control the code which dynamically creates the form and from which
you wish to intercept the form data, tracking <option> entries in some
process.
If your jsp/Servlet is intercepting a form for processing, prior to
presenting the form to a client, the process is a little more complex than
just parsing a form -- the process changes (a jsp/Servlet would act as a
filter, capturing client request-response, sending them on to the process
that dynamically creates the form data, processing the response form data
from this process, and sending the processed response on to the client,
probably implementing some tracking in the process).
If you want information on how to query and parse a form, let me know. Other
than this, more information on your design needs will be useful.
> neither can i have a stand alone function
> in JSP ; both of which i understand are
> not possible in JSP. How do i get around
> this problem?
There has been some discussion on jsp methods -- I think others have posed
that it is possible. Further, there are other ways to accomplish this design
goal, such as implementing a java-bean for needed utility methods.
Let me know if I can help further.
Phil Campbell
-----Original Message-----
From: Portal Team <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Monday, April 03, 2000 8:18 AM
Subject: Request.getParameter() question
>Hi
>
>I need to refer to *all* the values of a combobox in one page across the
>session.
>
>i can get the selected value by Request.getParameter("comboname");
>
>how can i refer to all the values?
>
>Eg. I have
>
><form name="myform" action="get.jsp">
><select name="mycombo"> <option> 1 <option> 2 <option 3 </select>
><input type="Submit">
></form>
>more values are added to the form dynamically
>
>in get.jsp i want to be able to read *all* the values of myform.mycombo
>
>i am unable to have jsp code within javascript code
><script>
>function put()
>{
><% write values of combo into vector which is put in session %>
>}
></script>
>
>neither can i have a stand alone function in JSP ; both of which i
>understand are not possible in JSP. How do i get around this problem?
>
>I would really appreciate your suggestions
>
>thank you in advance
>Vineet
>
>______________________________________________________
>Get Your Private, Free Email at http://www.hotmail.com
>
>===========================================================================
>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