-
Notifications
You must be signed in to change notification settings - Fork 3
/
formtest.html
84 lines (63 loc) · 2.58 KB
/
formtest.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
---
---
<!DOCTYPE html>
<html>
<head>
<title>Connexta: About Us </title>
{% include head.html %}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript" src="js/parallax.js"></script>
</head>
<body>
<div class="content-wrap">
{% include header.html %}
<section>
<div class="container">
<script>
$(function(){
// intercept the form submission
$("#contact-form").on("submit", function(e) {
e.preventDefault(); // stop the form from being submitted
// make an ajax POST request to the form's action
$.ajax({
type: "POST",
url: $(this).attr("action"), // use the form's action attribute as the endpoint
data: $(this).serialize(), // use the data from the form
headers:
{
"Accept": "application/json" // this makes the server send you a JSON response
},
success: function(response) // handle the successful submission of your POST
{
console.log(response); // response contains the form submission that was just made
$("#contact-form")[0].reset();// reset the form
$("#messages").show().text("Thank you for your submission. We'll get back to you soon");
},
});
});
});
</script>
<div id="messages" style="display: none"></div>
<form action="https://liveformhq.com/form/934055ac-e239-40f6-8345-e448192d73ec" method="POST" accept-charset="utf-8" id="contact-form">
<input type="hidden" name="_utf8" value="✓">
<!--
NOTE: This is an optional field, if your form has a field named '_redirect',
The user will be redirected to this page after the submission is saved
-->
<!-- <input type="hidden" value="https://mysite.com/redirect_thank_you" name="_redirect" /> -->
<label for="name">Name</label>
<input type="text" id="name" name="name"> <br />
<label for="email">Email</label>
<input type="text" id="email" name="email"> <br />
<label for="message">Message</label>
<textarea id="message" name="message"></textarea>
<!-- to add recaptcha, add the correct site key and uncomment the section below -->
<div class="g-recaptcha" data-sitekey="6LfT4CAUAAAAALSPFLMAxB1X6qJnw4QkaMyiF7PB" data-callback="enableSubmit"> </div>
<button type="submit" id="form-sumbit">Send Message</button>
</form>
</div>
</section>
{% include footer.html %}
</div><!-- /content-wrap -->
</body>
</html>