• Post Reply Bookmark Topic Watch Topic
  • New Topic

list......jsp, javascript  RSS feed

 
yukeshean
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
I want to pass all the values in a <select size=3 name=""> into a jsp processing page (.jsp) thru a html form.
How should actually i do that?
Can i get all the values (a list in an array), or only one value?
Please do give me some advice or solution asap.
Thanks
yukeshean
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
code your select object to allow for multiple selections:
<select name="mySelect" size="3" multiple="true">
...
</select>
At the server side, have a look at the method getParameterValues() of javax.servlet.ServletRequest which returns a String[] for parameters that might have more than one value.
James.
 
James Swan
Ranch Hand
Posts: 403
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I partially misread your post.
Here is some code to select all the values from your select object.
The server side comment still stands true though.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!