forked from civictechdc/codefordc.github.com
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contact.html
88 lines (82 loc) · 3.28 KB
/
contact.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
---
layout: default
title: Contact Us
extra_css:
- bootstrapValidator.min.css
extra_js:
- bootstrapValidator.min.js
---
<div class="container">
<div class="row">
<div class="col-sm-12 alert alert-success alert-dismissible hidden" role="alert">
<button type="button" class="close" data-dismiss="alert" title="dismiss"><span aria-hidden="true">×</span><span class="sr-only">Close</span></button>
<strong>Success!</strong> Thank you for your message.
</div>
<div class="col-sm-12 starter-template">
<h1>Contact Us</h1>
</div>
<div class="col-sm-8 col-sm-offset-2">
<p>Hi there! Use this form to contact the Code for DC leadership about anything.</p>
<p>If you are looking to partner with us, please help us out with <a href="/resources/partnering.html">some preliminary information</a>.</p>
<p>If you are reporting a code of conduct issue, please check our <a href="/resources/codeofconduct.html#Making-a-Report">sample report</a> so that we can help more effectively.</p>
</div>
<div class="col-sm-8 col-sm-offset-2">
<form id="contactus" role="form">
<div class="form-group">
<label for="email">Email</label>
<input type="email" class="form-control" id="email" placeholder="Email (optional)">
</div>
<div class="form-group">
<label for="name">Name</label>
<input type="text" class="form-control" id="name" placeholder="Name (optional)">
</div>
<div class="form-group">
<label for="subject">Subject</label>
<input type="text" class="form-control" id="subject" placeholder="Subject (optional)">
</div>
<div class="form-group">
<label for="message">Message</label>
<textarea name="message" class="form-control" id="message" rows="6" placeholder="What's up?"></textarea>
</div>
<button type="button submit" class="btn btn-primary" id="submitmessage">Submit</button>
</form>
</div>
</div>
</div>
{% include _global_js.html %}
<script type="text/javascript">
$(document).ready(function(){
$("#contactus").bootstrapValidator({
fields: {
message: {
validators: {
notEmpty: {
message: "You must enter a message"
}
}
}
}
});
$("#submitmessage").click(function(){
var payload = JSON.stringify({
"email": $("#email").val(),
"name": $("#name").val(),
"subject": $("#subject").val(),
"message": $("#message").val()
});
$.ajax({
url: "https://slackfordc.herokuapp.com/contact",
type: "POST",
data: payload,
contentType: "application/json",
success: function(){
$("#email").val("");
$("#name").val("");
$("#subject").val("");
$("#message").val("");
$(".alert").removeClass("hidden");
}
});
});
});
</script>