Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Inserting values from a datastore into a drop down list

 
Kamal Patel
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic