-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
101 lines (99 loc) · 3.92 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PEX Interest Form</title>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css2?family=Lato&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Dosis:wght@300&display=swap" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<div class="form-div">
<div class="form-container">
<div class="inner-div">
<div class="inner-cont">
<div class="header">
<img src="images/logo.png">
<h3>the fresh<br> farm market.</h3>
</div>
<p>PEX is a digital market platform that allows <br>users to buy and sell farm produce, tools and <br>inputs with the convenience of door to door delivery.</p>
<h1>SIGN UP FOR YOUR SHOP <br><center>FOR FREE!</center></h1>
<center><hr class="line"></center>
<form action="" id="contactForm">
<div class="field">
<label for="name">Name:</label>
<br>
<input id="name" type="text" name="name">
</div>
<div class="field">
<label for="email">Email:</label>
<br>
<input id="email" type="email" name="email">
</div>
<div class="field">
<label for="mobile">Phone Number:</label>
<br>
<input id="mobile" type="tel" name="phone">
</div>
<div class="field">
<label for="message">Message:</label>
<br>
<textarea id="message" type="text" name="message" cols="37" rows="3"></textarea>
</div>
<div class="submit">
<input type="submit" name="submit" value="SUBMIT">
</div>
</form>
</div>
</div>
<<<<<<< HEAD
</div>
</div>
<script>
$(document).ready(function(){
$("input[type=submit]").click(function(e){
e.preventDefault();
=======
<script>
contactForm.onsubmit = async (e) => {
e.preventDefault();
let formData = new FormData(document.getElementById('contactForm'));
formData.append('source', 'Website');
for (var pair of formData.entries()) {
console.log(pair[0]+ ', ' + pair[1]);
}
let response = await fetch('https://r35wi00jx5.execute-api.eu-west-1.amazonaws.com/develdee/feedback', {
method: 'POST',
mode: 'no-cors',
body: formData,
});
>>>>>>> cea9bba9f284afedfbe44751d908d03ba5c34db9
var apiGatewayInvokeURL = 'https://r35wi00jx5.execute-api.eu-west-1.amazonaws.com/develdee/feedback';
var body = {
name : $("#name").val(),
email : $("#email").val(),
mobile : $("#mobile").val(),
message: $("#message").val(),
source: 'Website'
};
fetch(apiGatewayInvokeURL, {
method: 'POST', // *GET, POST, PUT, DELETE, etc.
mode: 'no-cors', // no-cors, *cors, same-origin
cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached
headers: {
'Content-Type': 'application/json'
// 'Content-Type': 'application/x-www-form-urlencoded',
},
body: JSON.stringify(body) // body data type must match "Content-Type" header
}).then(response => {
$("#contactForm").trigger('reset');
alert('Feedback received successfull!');
}).catch(err => {
});
});
});
</script>
</body>
</html>