-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontact.html
More file actions
61 lines (52 loc) · 1.87 KB
/
contact.html
File metadata and controls
61 lines (52 loc) · 1.87 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
---
title: Contact
heading: Get in touch today
description: We'd love to help you build the AWS infrastructure you need.
---
<div class="contact-box">
<form id="contact-form" action="https://flqja1wyxf.execute-api.eu-west-1.amazonaws.com/latest/contact" method="post" class="contact-form">
<label for="name">Full Name</label>
<input type="text" name="name" id="name" placeholder="Enter your name..." required />
<label for="email">Email Address</label>
<input type="email" name="email" id="email" placeholder="Enter your email..." required />
<label for="message">Message</label>
<textarea name="message" id="message" placeholder="Enter your message..." required ></textarea>
<input type="submit" value="Send Message" />
</form>
</div>
<!-- jQuery -->
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.0/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/jquery.validation/1.15.0/additional-methods.min.js"></script>
<script>
$('#contact-form').validate({
submitHandler: function(form, err) {
if ($('#contact-form').valid()) {
$('#contact-form input[type=submit]').html('Processing...');
$.ajax({
url: form.action,
type: form.method,
data: $(form).serialize(),
success: function(response) {
$('form').html('<div style="text-align:center"><h3>Thank you!</h3><p>We\'ll be in contact shortly!</p></div>');
},
error: function(response) {
$('form').html('<div style="text-align:center"><h3>Ooops!</h3><p>There was an error with your enquiry!</p></div>');
}
});
}
},
rules: {
name: {
required: true
},
email: {
required: true,
email: true
},
message: {
required: true
}
}
});
</script>