-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2.jsp
More file actions
52 lines (51 loc) · 1.39 KB
/
2.jsp
File metadata and controls
52 lines (51 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<%@ 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">
<script type="text/javascript">
function fn() {
var x = document.getElementById('fn');
var htp = new XMLHttpRequest();
htp.onreadystatechange = function() {
if (htp.readyState == 4) {
var jsn = JSON.parse(htp.responseText);
if (jsn.length > 0) {
for (var i = 0; i < jsn.length; i++) {
t1.style.display = "";
var r = t1.insertRow(-1);
var c0 = r.insertCell(0);
c0.innerHTML = jsn[i].Fn;
var c1 = r.insertCell(1);
c1.innerHTML = jsn[i].Ln;
var c2 = r.insertCell(2);
c2.innerHTML = jsn[i].Un;
}
} else {
alert("Incorrect Name")
}
}
}
htp.open("post", "RegCont?fn=" + x.value, true);
htp.send();
}
</script>
<title>Insert title here</title>
</head>
<body>
<center>
Username<input type="text" id="fn"><br> <br>
<button onclick="fn()">Submit</button>
<br> <br>
<table border="1" id="t1"
style="display: none; border-collapse: collapse; font-family: jokerman">
<tr>
<th>Firstname</th>
<th>Lastname</th>
<th>Username</th>
</tr>
</table>
</center>
</body>
</html>