-
Notifications
You must be signed in to change notification settings - Fork 0
/
signup.html
125 lines (102 loc) · 4.05 KB
/
signup.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
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="styles.css">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-ygbV9kiqUc6oa4msXn9868pTtWMgiQaeYH7/t7LECLbyPA2x65Kgf80OJFdroafW"
crossorigin="anonymous"></script>
<script src="https://kit.fontawesome.com/c9735f6ea9.js" crossorigin="anonymous"></script>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Add Product</title>
</head>
<body>
<!-- header area -->
<div>
<nav style="background-color: #389da9!important; margin-bottom: 20px;"
class=" navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent"
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="./">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">About us.</a>
</li>
</div>
</div>
</nav>
</div>
<!--From for adding product-->
<div class="row">
<div class="col-3"></div>
<div class="col-6">
<h1 style="margin-top: 30px; margin-bottom: 30px;"> New User </h1>
<form>
<div class="form-group">
<input type="text" class="form-control inputField" id="name" placeholder="Enter Full Name">
<input type="email" class="form-control inputField" id="email" placeholder="Enter Email">
<input type="number" class="form-control inputField" id="number" placeholder="Contact Number">
<input type="password" class="form-control inputField" id="password" placeholder="Password">
<div style="background-color: #ffffff; padding:10px;border-radius: 5px;">
<b>Signup As: </b>
<input style=" margin:10px" type="radio" name="sign" value="Admin">Admin
<input style=" margin:10px" type="radio" name="sign" value="Buyer">Buyer
<input style=" margin:10px" type="radio" name="sign" value="Seller">Seller
</div>
<br>
</div>
<div class="row">
<button id="signup" type="submit" class="custombutton btn btn-primary col-md-6">Signup</button>
<button href="index.html" type="calcel" class="btn btn-danger col-md-6">Cancel</button>
</div>
</form>
</div>
<div class="col-3"></div>
</div>
<script src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="jquery.min.js"></script>
<!--<script src="script.js"></script> -->
<script>
$('#signup').click(function () {
var ele = document.getElementsByName('sign');
for (i = 0; i < ele.length; i++) {
if (ele[i].checked) {
var accounttype = ele[i].value
}
}
let name = $("#name").val()
let email = $("#email").val()
let number = $("#number").val()
let password = $("#password").val()
let va = accounttype;
let newUser = {
name: name,
email: email,
number: number,
password: password,
accounttype: va,
}
$.ajax({
type: 'POST',
url: '/user/new',
data: newUser,
success: response => {
console.log(response)
},
error: response => {
console.log(response)
}
})
})
</script>
</body>
</html>