I have 1 HTML table populated from the database. It has radio buttons in every row. At the end, there is one submit button to reflect the changes into the database if the user selects radio button in one or more rows.
How to know in which rows user has selected radio buttons.
Code is completely written in Html, Jsp and java script.
Presumably each row of the table has a primary key? Give the checkboxes all the same name, and make the values of the checkboxes the primary key for that row, and you'll know which ones have been selected.
Personally, I'd replace the Pass/Fail group of radio buttons with a checkbox where checked means pass. A lot easier to deal with and would look better.
But if you can't do that, you need to generate a unique name for each group since radio buttons are grouped by name. I'd format the name using the primary key so that when the form is submitted you can parse each parameter to know which row the submitted value "belongs" to. Make the radio button values "true" and "false".
Abhishek Kumar Saxena
Joined: Aug 09, 2013
Thanks for your reply Sir,
I tried using checkbox first, but I was not able to select one checkbox between two as there is no group defined for them.
I thought it would be easier to use radio buttons, but it seems i am not finding a way here too.
In the snapshot attached in the last post, if I'd use checkbox then how can I submit details of every checkbox to another jsp?