javascript - Radio button holds only one value in table? -
i have table in html form dynamically generated database.so,here used loop.now what's problem in entire table radio button holds 1 value.but want hold 1 value in each row , unable find solution.for in advance.
<table class="table" id="attendancetableid" style="width: 500px;"> <% for(int i=0;i<=se.size()-1;i++) { %> <tr> <td><input type="textbox" name="studentname" value="<%=se.get(i)%>" style="background-color: #a7c5c2" readonly></td> <td><input type="radio" name="status" value="present" style="width: 15px; height: 15px;" />present <input type="radio" name="status" value="absent" style="width: 15px; height: 15px;">absent</td> </tr> <% } %> </table>
use name="status_<%= %>"
or similar name parameter of radio input tags. currently, share same name
, , therefore grouped together. each radio button group can have 1 selected value. if include row index in name parameter, 1 radio button group per row.