Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

create arrays from html table and pass as params to servlet  RSS feed

 
Edmund Castermund
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a javascript function that will create an html form/table based on user input. I was trying to create a javascript function that will grab the array values, and then pass as params to a servlet but am not having luck. Here's a mockup of what I was trying:




How does one pick up arrays/maps other structures and pass as arrays to servlets? The only way I've seen is in select or radio button groups.
thanks,
bp
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66205
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create multiple hidden inputs with the same name, and then on the server use request.getParameterValues() to retrieve the values as an array.
 
Edmund Castermund
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Create multiple hidden inputs with the same name, and then on the server use request.getParameterValues() to retrieve the values as an array.


k, thanks a lot. the following form:



produced this in the url window when hitting the submit button:



thanks,
bp
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!