forked from expanse-org/expanse-org.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
send.js
71 lines (56 loc) · 1.95 KB
/
send.js
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
$(function () {
$('form').on('submit', function (e) {
e.preventDefault();
swal({
title: "Wait",
text: "Message Sending is in process",
imageUrl: "img/favicon.ico"
});
$.ajax({
type: 'post',
url: 'ajax/check.php',
data: $('form').serialize(),
success: function (data) {
if(data.error === true){
swal('ERROR!', data.message, 'error');
}
else{
swal({
title: "Thank you for contacting us.",
text: "Your message has been successfully sent.",
imageUrl: "img/favicon.ico"
});
$("#yname").val("");
$("#yemail").val("");
$("#ycomment").val("");
}
},
error: function (data) {
if(data.error === true){
swal({
title: "OOpss!!Something went wrong",
text: "A problem occur your message has not been sent. Please try again later",
imageUrl: "img/favicon.ico"
});
}
else{
swal({
title: "Thank you for contacting us.",
text: "Your message has been successfully sent.",
imageUrl: "img/favicon.ico"
});
$("#yname").val("");
$("#yemail").val("");
$("#ycomment").val("");
}
}
});
$.ajax({
type: 'post',
url: 'ajax/check2.php',
data: $('form').serialize(),
success: function (data) {
}
});
});
});