开发者

Multiple select how to capture all selections in java

开发者 https://www.devze.com 2023-01-12 19:22 出处:网络
I am using a multiple options select in my HTML form, when I select more than one option and use the \'GET\' method in my form I s开发者_高级运维ee this

I am using a multiple options select in my HTML form, when I select more than one option and use the 'GET' method in my form I s开发者_高级运维ee this

url?Ripples=1.3&Ripples=1.4

As you can see each selection has the same name, when I pass this to my jsp and display the variable I only get this first option which in this case is 1.3. How do I get all the selections into my java strings?


you can use

String[] ripples = request.getParameterValues("Ripples");


Ideally this should be handled by a POST request.


request.getParameterValues("Ripples")


request.getParameterValues(argument) will return a list of the selected items.

0

精彩评论

暂无评论...
验证码 换一张
取 消