blob: 51367e140d08a006932fc5b72f17b716ad418a00 [file] [log] [blame]
Anand Doshi79c4d7c2013-11-21 18:28:25 +05301<div class="container">
2 <div class="row">
3 <div class="input-group col-sm-6 col-sm-offset-3" style="margin-top: 7px;">
4 <input class="form-control" type="text" id="footer-subscribe-email" placeholder="Your email address...">
5 <span class="input-group-btn">
6 <button class="btn btn-default" type="button" id="footer-subscribe-button">Stay Updated</button>
7 </span>
8 </div>
9 </div>
Rushabh Mehta4c6120a2013-09-10 12:18:58 +053010</div>
Rushabh Mehta4c6120a2013-09-10 12:18:58 +053011<script>
12 $("#footer-subscribe-button").click(function() {
13
14 $("#footer-subscribe-email").attr('disabled', true);
15 $("#footer-subscribe-button").html("Sending...")
16 .attr("disabled", true);
17
18 if($("#footer-subscribe-email").val()) {
19 erpnext.send_message({
20 subject:"Subscribe me",
21 sender: $("#footer-subscribe-email").val(),
22 message: "Subscribe to newsletter (via website footer).",
23 callback: function(r) {
24 if(!r.exc) {
25 $("#footer-subscribe-button").html("Thank You :)")
26 .addClass("btn-success").attr("disabled", true);
27 } else {
28 $("#footer-subscribe-button").html("Error :( Not a valid id?")
29 .addClass("btn-danger").attr("disabled", false);
30 $("#footer-subscribe-email").val("").attr('disabled', false);
31 }
32 }
33 });
34 }
35 });
36</script>