This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Code for JSP dropdown menu

 
Reuben Fields
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot, i'll try that!
 
Reuben Fields
Greenhorn
Posts: 15
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic