Forum Moderators: open
I have a list box in a .jsp.
<SELECT name="groupname">
<option value ="business">Business
<option value ="accounting">Accounting
....
</select>
<input type="submit" value="Names">
I need to send the selected group name to another .jsp. I don't know how to receive it or send it without using javascrip. I am using form method="post". I want to use String name= request.getParameter("groupname") like this way in my next .jsp.
How can I do it?
Thanks
I'm not sure why you're having a problem. It may be as simple as a typo on the page that receives the form data. Here's the basics of what you should have:
The form
<form method="POST" action="secondJSP.jsp">
<SELECT name="groupname">
<option value ="business">Business
<option value ="accounting">Accounting
....
</select>
<input type="submit" value="Names">
</form>
"secondJSP.jsp"
<%@ page language="java"
session="true"
isThreadSafe="true"
contentType="text/html; charset=ISO-8859-1" %>
<% String name;
name = request.getParameter("groupname");
%>
<html>
...
If you don't see your problem from that example, maybe you can post your code? What is the error you're getting?