aboutsummaryrefslogtreecommitdiff
path: root/assets/js/lustiges-script.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--assets/js/lustiges-script.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index ef685d0..447341f 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -380,9 +380,23 @@ $(function() {
// feedback form
$(function() {
- $('.feedback-form').on('submit', function() {
+ $('.feedback-form').on('submit', function(e) {
+ e.preventDefault();
+ var $form = $(this);
+
$('.feedback-form').hide();
- $('.feedback-thankyou').show();
+ $.ajax({
+ url: $form.prop('action'),
+ method: $form.prop('method'),
+ data: $form.serialize(),
+ success: function() {
+ $('.feedback-thankyou').show();
+ },
+ error: function() {
+ $('.feedback-error').show();
+ }
+ });
+
});
});