tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wendy Smoak <>
Subject RE: Populating One <select> Based On The Value In Another
Date Mon, 05 May 2003 21:26:44 GMT
> I've got a JSP with two <select> tags in it.  
> I populate the first by iterating through a
> java.util.List using the JSTL <c:forEach> tag.
> When a user makes a selection from the first <select>,
> I'd like to populate the second <select> option list
> based on that selection.  

When do you want this to happen?  Unless you use JavaScript on the client
side, you don't really have another chance to affect the contents of the
second drop-down box until the form gets submitted.

> How do I get the "key" value out of the first <select>
> and into JSTL?  Seems like a common operation.  I'd
> appreciate any advice that anyone could offer.  Thanks

When the form is submitted, the user's choice will come through as a request
parameter, so you can get it with (I haven't done this, I use Struts) but I
think it's ${param.formFieldName}.  I'm looking at the example on the second
page of the JSTL in Action Appendix pdf that's available free online.

Wendy Smoak
Applications Systems Analyst, Sr.
Arizona State University PA Information Resources Management

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message