• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

select tag in jsp

 
ashish sood
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64718
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic