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 select tag in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "select tag in jsp" Watch "select tag in jsp" New topic
Author

select tag in jsp

ashish sood
Greenhorn

Joined: Oct 03, 2009
Posts: 8
hello,
I am trying to populate my select tag with values from the database but problem is that i am getting different drop down menus for each value of database.

<form action="checkt1.jsp" method="post">
<select name="val1"><option value="not specified">S E L E C T</option>
<%
while (rs2.next())
{
val=rs2.getString(1);
out.println("<option value='"+val+"'>"+val+"</option>");
}
%>
</select>

please help..
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61448
    
  67

Have you looked at the HTML being sent to the browser? Is it correct?

And why are you still using Java scriptlets in a JP?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
wood burning stoves
 
subject: select tag in jsp