File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes Inserting values from a datastore into a drop down list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Inserting values from a datastore into a drop down list " Watch "Inserting values from a datastore into a drop down list " New topic
Author

Inserting values from a datastore into a drop down list

Kamal Patel
Greenhorn

Joined: Nov 05, 2003
Posts: 18
Hi,
I was wondering if anyone knows how to, or has an example of generating vales i.e. names, that are extracted from a datastore, into a combo or drop down list on a JSP/web page? Do I have to use Javascript, or can I just use HTML and java?
Thanks.
Rob Hunter
Ranch Hand

Joined: Apr 09, 2002
Posts: 805
Hi,
Just java and html is fine. Do something like this :
<SELECT tag
<% do your loop here to get each value %>
<option value="<%=value from loop%>"> <%=value to display%></option>
<% end of the loop %>
End of Select tag>
Rob
 
Don't get me started about those stupid light bulbs.
 
subject: Inserting values from a datastore into a drop down list
 
Similar Threads
JSP To Servlet
How to retrieve data from database when ever select in drop down list?
Reg : Drop-down box
dependent drop down list
JSP CODE TO SELECT A DROP DOWN LIST ITEM