0

I want to get values from selected radio button in jsp form to my servlet.How to get values in servlet,For any help thanks 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_<%= i %>" value="Present" style="width: 15px; height: 15px;" />Present

         <input type="radio" name="status_<%= i %>" value="Absent" style="width: 15px; height: 15px;">Absent</td>
      </tr>

    <%
    }
    %>
    </table>    

1 Answers1

0

You want to get this value as same as you have implemented in the 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);
   }
}
Dinidu Hewage
  • 2,169
  • 6
  • 40
  • 51