<html>
<head>
<title>HTML Request Parameters</title>
</head>
<body>
<h2>Choose an Actor:</h2>
<form method="get">
<input type="checkbox" name="actor" value="Shahrukh Khan">Shahrukh Khan
<input type="checkbox" name="actor" value="Amir Khan">Amir Khan
<input type="checkbox" name="actor" value="Salman Khan">Salman Khan
<input type="submit" value="Query">
</form>
<%
String[] actors = request.getParameterValues("actor");
if (actors != null) {
%>
<h3>You have selected actor(s):</h3>
<ul>
<%
for (int cnt = 0; cnt < actors.length; cnt++) {
%>
<li><%= actors[cnt] %></li>
<%
}
%>
</ul>
<a href="<%= request.getRequestURI() %>">Go Home</a>
<%
}
%>
</body>
</html>
<head>
<title>HTML Request Parameters</title>
</head>
<body>
<h2>Choose an Actor:</h2>
<form method="get">
<input type="checkbox" name="actor" value="Shahrukh Khan">Shahrukh Khan
<input type="checkbox" name="actor" value="Amir Khan">Amir Khan
<input type="checkbox" name="actor" value="Salman Khan">Salman Khan
<input type="submit" value="Query">
</form>
<%
String[] actors = request.getParameterValues("actor");
if (actors != null) {
%>
<h3>You have selected actor(s):</h3>
<ul>
<%
for (int cnt = 0; cnt < actors.length; cnt++) {
%>
<li><%= actors[cnt] %></li>
<%
}
%>
</ul>
<a href="<%= request.getRequestURI() %>">Go Home</a>
<%
}
%>
</body>
</html>
No comments:
Post a Comment