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 pathdelete.html
More file actions
43 lines (42 loc) · 1.54 KB
/
delete.html
File metadata and controls
43 lines (42 loc) · 1.54 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
<!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/delete.css">
<link rel="shortcut icon" href="./image/rocken.ico" type="image/x-icon" />
<title>Delete</title>
</head>
<body>
<br><br>
<h1>选择按何种方式删除</h1>
<form id="postForm">
<label for="id">员工编号</label>
<input type="text" id="id"><br>
<label for="name">员工姓名</label>
<input type="text" id="name"><br>
<label for="idCard">身份证号</label>
<input type="text" id="idCard"><br>
<input type="submit" value="提交" class="submit">
</form>
<script>
document.getElementById('postForm').addEventListener('submit',postForm);
function postForm(e){
e.preventDefault();
var name = document.getElementById("name").value;
var id = document.getElementById("id").value;
var idCard = document.getElementById("idCard").value;
var params= "name="+name+"&id="+id+"&idCard="+idCard;
var xhr = new XMLHttpRequest();
xhr.open('POST','delete.php',true);
xhr.setRequestHeader('Content-type','application/x-www-form-urlencoded');
xhr.onload = function(){
console.log(this.responseText);
}
xhr.send(params);
alert('删除成功');
}
</script>
</body>
</html>