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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inserting multiple Rows

Status
Not open for further replies.

stritec

Programmer
Oct 23, 2000
9
0
0
US
Hello,

I'm trying to select multiple items from a combo box that has 'multiple' (turned on). I want to select many items from that list then have them all written to a table in a database.

What's the best way to do this?

The way I'm doing it right now, it's only grabbing the first option value from the select statement. So when I select more than one item, item then hit the submit button to pass the parameters to the next page, I do a
Code:
String right = request.getParameter("Right");
and it only gets the first one that I selected and ignores the rest.

Thanks for any help that's available.

Curt
 
Dear Curt,

Take a look at javax.servlet.ServletRequest.getParamterValues( java.lang.String name)

Good luck
-pete
 
Here is the code :
String[] str=request.getParameterValues("Right");

for(int i=0;i<str.length;i++)
out.println(&quot;<br>&quot; + str);

This works fine. It will print all the values slected in the mulitple select combo box.
Cheers!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top