jsp - How to get radio button group values in servlet? -
this question has answer here:
i want values selected radio button in jsp form servlet.how values in servlet,for in advance.
jsp page is: <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>
you want value same have implemented in form
public void dopost(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { for(int i=0;i<=se.size()-1;i++) { string status = request.getparameter("status_"+i); } }