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 Code for JSP dropdown menu 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 "Code for JSP dropdown menu" Watch "Code for JSP dropdown menu" New topic
Author

Code for JSP dropdown menu

Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
Hi,

Could anyone tell me how to put the following into a dropdown menu please?

<%
String county_name = result.getString(1);
out.print("");
out.println(county_name);
String service_name = result.getString(2);
out.print("Service: ");
out.println(service_name);
Raghuraman Muthuswamy
Ranch Hand

Joined: Mar 18, 2003
Posts: 73
The simple code snippet is,

<select>
<%
while(re.next())
{
String name1 = re.getString(1);

%>
<option value="<%= name1%>"><%= name1%></option>
<%
}
%>
</select>

Develop the code as per your requirement.

regards,
Raghu
Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
Thanks a lot, i'll try that!
Reuben Fields
Greenhorn

Joined: Apr 05, 2005
Posts: 15
Hi Raghu,

Would you know the code for being able to click on one word from a list of results from a database and have it just bring up the details on that one word?

I heard that you need to use ? and the name of the database field in the a href tag?

Here is some of my code...


<a href="servicedetails.jsp">

<%
String county_name = result.getString(1);
out.print("");
out.println(county_name);
String service_name = result.getString(2);
out.print("Service: ");
out.println(service_name);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Code for JSP dropdown menu
 
Similar Threads
Reading a JSP word that is clicked on
I'm posted 1000000000 times tell me idea
how do i convert 0x64766972 to dvir
Dropdown Navigation Menu
page refresh problem