-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate.html
139 lines (134 loc) · 8.17 KB
/
create.html
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, initial-scale=1.0">
<title>Create contact</title>
<link rel="stylesheet" href="css/bootstrap4.5.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery3.6.0.min.js"></script>
<script src="js/script.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.bundle.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/feather-icons/4.27.0/feather.min.js" integrity="sha256-xHkYry2yRjy99N8axsS5UL/xLHghksrFOGKm9HvFZIs=" crossorigin="anonymous"></script>
</head>
<body>
<div class="container">
<!-- Navbar -->
<div class="row">
<div class="col-md-12">
<div class="top-breadcrumb">
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
<li class="mr-4"><a href="index.html" class=" text-dark"><i class="feather" data-feather="arrow-left"></i></a></li>
<li class="mr-4"><a href="index.html" class=" text-dark">Contacts</a></li>
<li class="mr-4"><a href="create.html" class=" text-dark"><i class="feather" data-feather="plus"></i></a></li>
</ol>
</nav>
</div>
</div>
</div>
<div class="row">
<!-- Start col -->
<div class="col-lg-12">
<div class="card m-b-30">
<form action="https://webhook.site/14e51441-12f1-4efa-8bfc-5334838e1bc2" method="post" id="createForm">
<div class="card-body py-5">
<div class="row">
<div class="col-lg-3 text-center">
<label for="avatar">
<img src="images/default.jpg" class="img-fluid mb-3" alt="user" />
</label>
<input type="file" class="form-control-file" id="avatar">
</div>
<div class="col-lg-9">
<form action="">
<div class="form-group">
<input class="form-control form-control-plaintext w-25 d-inline-block" type="text" name="first_name" placeholder="First name">
<input class="form-control form-control-plaintext w-25 d-inline-block" type="text" name="last_name" placeholder="Last name">
<input class="form-control form-control-sm mt-2 form-control-plaintext" type="text" name="phone" placeholder="Phone number">
</div>
<div class="table-responsive">
<table class="table table-borderless mb-0">
<tbody>
<tr>
<th scope="row" class="p-1"><label for="email" class="mb-0">Email</label></th>
<td class="p-1"><input type="email" class="form-control-plaintext py-0" id="email" name="email" placeholder="email@example.com"></td>
</tr>
<tr>
<th scope="row" class="p-1"><label class="mb-0">Gender</label></th>
<td class="p-1">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" id="male" value="male">
<label class="form-check-label" for="male">Male</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="gender" id="female" value="female">
<label class="form-check-label" for="female">Female</label>
</div>
</td>
</tr>
<tr>
<th scope="row" class="p-1"><label class="mb-0">Title</label></th>
<td class="p-1">
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="name_title" id="Mr" value="Mr">
<label class="form-check-label" for="Mr">Mr</label>
</div>
<div class="form-check form-check-inline">
<input class="form-check-input" type="radio" name="name_title" id="Ms" value="Ms">
<label class="form-check-label" for="Ms">Ms</label>
</div>
</td>
</tr>
<tr>
<th scope="row" class="p-1"><label for="country" class="mb-0">Country</label></th>
<td class="p-1"><input name="country" type="text" class="form-control-plaintext py-0" id="country" placeholder="country"></td>
</tr>
<tr>
<th scope="row" class="p-1"><label for="city" class="mb-0">City</label></th>
<td class="p-1"><input name="city" type="text" class="form-control-plaintext py-0" id="city" placeholder="city"></td>
</tr>
</tbody>
</table>
</div>
</form>
</div>
</div>
<div class="text-center">
<button type="submit" class="btn btn-primary" id="create">Create</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script>
$("#createForm").submit(function(e) {
e.preventDefault();
let form = $(this);
let url = form.attr('action');
$.ajax({
type: "POST",
url: url,
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
},
data: form.serialize(),
success: function(data) {
let Done = () => `
<img src="images/tick.png" alt="tick" style="width: 30px" class="d-inline-block"/>
<p class="d-inline-block">ثبت شد</p>
`;
$("#create").replaceWith(Done());
},
error: () => alert('Something went wrong!')
});
});
</script>
<script>
feather.replace()
</script>
</body>
</html>