javascripthtmlajaxjsp

How to pass selected rows from a table as request parameters on form submit?


I'm developing a web app (jsp) that extracts some data from a .doc file. Headings from an uploaded document is extracted and listed in a table as below.

Generated output on upload-screenshot

I have added a check-box for each row. Next what I want to do is save the check-box checked rows into an xml. I know how to write xml but how to do it only with the checked rows on form submit? My question summery is, How can I pass those checked rows from table on form submit as request parameters.


Solution

  • Creating checkbox array by keeping same name for all checkboxes will give you what you want. In java, after submitting your form you read it in your servlet as 'request.getParameterValues("checkboxname")'. you will get checked checkboxes from the array returned.