
<%@page import="java.sql.*"%>
<%@page import="java.util.*"%>
<%@ page session="true"%>
<%@page import="java.io.*"%>
<%@page import="java.net.*"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script>
function updateStud()
{
alert('hasi');
var updObj = document.getElementById('form2');
updObj.action = "Update.do";
updObj.method = "post";
updObj.onsubmit="true";
}
function deleteStud(){
alert('hasi');
vat delObj = document.getElementById('form2');
updObj.action = "Delete.do";
updObj.method = "post";
}
</script>
</head>
<body>
<h1>Search Page</h1>
<form name="form" action="Search.do" onsubmit="true" method="post">
Enter the ID to search: <input type="text" name="ID"></input><br></br>
<input type="submit" value="Search"></input>
</form>
<%
ArrayList arrayobj=(ArrayList)request.getAttribute("searchlist");
String id="";
String name="";
String age="";
String college="";
try
{
if(arrayobj.isEmpty()==false)
{
id=(String) arrayobj.get(0);
name=(String) arrayobj.get(1);
age=(String) arrayobj.get(2);
college=(String) arrayobj.get(3);
}
else
{
id="";
name="";
age="";
college="";
}
}catch(Exception e)
{
}
%>
<form name="form2" action="Update.do" onsubmit="true" method="post" >
Enter the ID to search: <input type="text" name="searchID" value="<%=id%>" readonly="readonly"></input><br></br>
Enter the name: <input type="text" name="UpdateName" value="<%=name%>"></input><br></br>
Enter the age: <input type="text" name="UpdateAge" value="<%=age%>"></input><br></br>
Enter the College : <select name="UpdateCollege">
<option value="<%=college%>"><%=college%></option>
</select><br></br>
<button type="submit" value="Update" >Update</button>
<a href="Index.jsp">Home</a>
</form>
</body>
</html>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.