Assuming you want a specific drop-down list selected when
you open your jsp passing in some parameter to pre-select it
you'd write something like:
<select name="myList">
  <option value="v1" <%= ( (request.getParameter("myList")).equals("v1") ? "SELECTED" 
: "" ) %>>
  <option value="v2" <%= ( (request.getParameter("myList")).equals("v2") ? "SELECTED" 
: "" ) %>>
</select>

If you have a multi-valued list box, you might consider using JSP code to
dynamically create a JavaScript function body that sets the values in
your list box and then calling that function on the onLoad event for
your page.

HTH
Pete ([EMAIL PROTECTED])


--- arun s <[EMAIL PROTECTED]> wrote:
> Hi all,
>   Im using JSP variables to set values in textareas and List boxes.Im able
> to do for text areas, But I dont know how to select a item in a  list box
> using this variable.
>   Can any one say how to select a a particular item  from a group of items
> using a JSP variable. Its urgent so plz reply me soon.
> rgds,
> karthik


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to