-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.html
39 lines (39 loc) · 1.38 KB
/
test.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
<script src="//code.jquery.com/jquery-1.12.0.min.js"></script>
<script>
$("#contact-form").validate({
submitHandler: function(form) {
$.ajax({
url: "//formspree.io/[email protected]",
method: "POST",
data: {
name: $(form).find("input[name='name']").val(),
_replyto: $(form).find("input[name='_replyto']").val(),
message: $(form).find("textarea[name='message']").val()
},
dataType: "json",
success: function() {
$("#submit-success").fadeIn();
$("#contact-form").fadeOut();
},
error: function() {
$("#submit-errors").fadeIn();
}
});
}
});
</script>
<form id="contact-form" class="form" action="/">
<div class="form-group">
<label for="name">Name</label>
<input class="form-control" type="text" name="name" required="" placeholder="Name">
</div>
<div class="form-group">
<label for="email">Email</label>
<input class="form-control" type="email" name="_replyto" required="" placeholder="[email protected]">
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea class="form-control" name="message" placeholder="Message" required="" rows="5"></textarea>
</div>
<input class="btn btn-primary" type="submit" value="Send">
</form>