-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
86 lines (83 loc) · 2.95 KB
/
index.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
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Test Ezform</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@1/css/pico.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.0/css/bootstrap-grid.min.css">
<style>
section{
padding-top: 32px;
padding-bottom: 32px;
}
.h100vh{
height: 100vh;
}
fieldset{
margin-bottom: 0px;
}
</style>
</head>
<body>
<div class="main">
<section style="padding:0px;">
<div class="container">
<div class="row h100vh d-flex align-items-center">
<div class="col-12 col-md-6 offset-md-4">
<form action="http://localhost:8080/api/login" method="post" id="login-form">
<img src="https://stg.getracer.com/img/racer.png" alt="Racer Logo" style="width:30%;margin-bottom:32px;margin-left:auto;margin-right:auto;display:block;">
<fieldset>
<label for="email">Email</label>
<input type="email" class="form-control" name="email" id="email">
</fieldset>
<input type="file" name="file">
<fieldset>
<label for="password">Password</label>
<input type="password" name="password" id="password">
</fieldset>
<br>
<button class="btn btn-primary">Login</button>
</form>
</div>
</div>
</div>
</section>
</div>
<script src="ezform.js" type="text/javascript"></script>
<script>
new postForm({
url: 'http://localhost:8080/api/login',
form: '#login-form',
formData: [
{
name: 'email',
validate: 'required|email',
},
{
name: 'file',
validate: 'required',
},
{
name: 'password',
validate: 'required',
validate_message: {
required: 'Test password is required'
}
}
],
headers: {
'Authorization': '5599a739d0041'
},
beforeSubmit: function(){
// acts as a middleware, return false to stop form submit
},
onSuccess: function(e){
console.log(e);
},
onError: function(e){
console.log(e);
}
})
</script>
</body>
</html>