1

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.

2
  • do you want do by using javascript?? Commented Nov 1, 2015 at 13:37
  • Fine. Anything that does the job. Commented Nov 1, 2015 at 13:41

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Wow.. Thanks @Raj .. :) Used your solution in a different way. And that made it.
0

HTML

<table class="table">
<tr value="1" class="side-link">
    <td>one</td>
    <td>two</td>
</tr>
<tr value="2" class="side-link">
    <td>one</td>
    <td>two</td>
</tr>
</table>

JavaScript

$(".table").on('click','tr',function(e){
e.preventDefault();
var id = $(this).attr('value');
alert(id);
}); 

Demo

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.