This repository was archived by the owner on Aug 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInquire.html
More file actions
50 lines (49 loc) · 2.01 KB
/
Inquire.html
File metadata and controls
50 lines (49 loc) · 2.01 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="./css/Inquire.css">
<link rel="shortcut icon" href="./image/rocken.ico" type="image/x-icon" />
<title>Inquire</title>
</head>
<body>
<h1>请选择查询方式</h1>
<form id="postForm">
<label for="i">员工编号</label>
<input type="text" id="i" class="in"><br>
<label for="nam">员工姓名</label>
<input type="text" id="nam" class="in"><br>
<label for="idCar">身份证号</label>
<input type="text" id="idCar" class="in"><br>
<label for="isFre">是否空闲</label>
<input type="text" id="isFre" class="in"><br>
<label for="isHealt">健康状况</label>
<input type="text" id="isHealt" class="in"><br>
<input type="submit" value="提交" class="submit">
<input type="reset" value="重置" class="reset">
</form>
<div id="users">
</div>
<script>
document.getElementById('postForm').addEventListener('submit',postForm);
function postForm(e){
e.preventDefault();
var name = document.getElementById("nam").value;
var id = document.getElementById("i").value;
var idCard = document.getElementById("idCar").value;
var isFree = document.getElementById("isFre").value;
var isHealth = document.getElementById("isHealt").value;
var params= "name="+name+"&id="+id+"&idCard="+idCard+"&isFree="+isFree+"&isHealth="+isHealth;
var xhr = new XMLHttpRequest();
xhr.open('POST',"Inquire.php",true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.onload = function(){
document.getElementById("users").innerHTML=xhr.responseText;
}
xhr.send(params);
}
</script>
</body>
</html>