Pr.Pg Next Pg

JSP Program for checkbox processing tutorials

 

JSP program for checkbox processing

Sam Sir

<%-- checkboxProcess.jsp --%>

<%-- JSP program for checkbox processing --%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>Checkbox Process</title>

</head>

<body>

<table>

<tr>

<td>Hard Disk Flag:</td>

<td><%=request.getParameter("HardDisk") %> </td>

</tr>

<tr>

<td>Mouse Flag:</td>

<td><%=request.getParameter("Mouse")%></td>

</tr>

<tr>

<td>Key Board Flag:</td>

<td><%=request.getParameter("KeyBoard")%> </td>

</tr>

<tr>

<td>RAM Flag:</td>

<td><%=request.getParameter("RAM") %></td>

</tr>

<tr>

<td>CD-ROM:</td>

<td><%=request.getParameter("CD-ROM") %> </td>

</tr>

</table>

</body>

</html>

 

 

 


 

HTML for user input which will be processed by checkboxProcess.jsp

Sam Sir

<!—checkbox.html -->

 

<html>

<head>

<title>CheckBox Data</title>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

</head>

<body>

<Center><h3>Passing checkbox data in JSP</h3></Center>

<form action="checkboxProcess.jsp" method="post">

<input type="checkbox" name="HardDisk" checked="checked">Hard Disk

<input type="checkbox" name="Mouse">Mouse

<input type="checkbox" name="KeyBoard" checked="checked">Key Board

<input type="checkbox" name="RAM" checked="checked">RAM

<input type="checkbox" name="CD-ROM">CD-ROM

<input type="submit">

</form>

</body>

</html>

Output

checkbox processing

 

checkbox processing

Pr.Pg border                                              Next Pg