Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get value of html combo box (i.e select) in jsp?

Status
Not open for further replies.

raf35

Programmer
Mar 6, 2005
3
0
0
US
Hello,

I was just wondering how to get value of html combo box in jsp page. My code for combo box is:

<select name="combo" size="1">
<%
List<Project> projects = mgr.getProjects();
for(Project project : projects){
%>
<option value="<%= project.getId()%>"><%= project.getName()%></option>
<%
}
%>
</select>

I thought combo.value might give me the value, but it throws exception.

Any help is appreciated.

Thanks.
 
If its in a form, and you attempting to get the submitted values from another page, then :

request.getParameter("combo);


--------------------------------------------------
Free Java/J2EE Database Connection Pooling Software
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top