diff --git a/files/assets/CHRISTMAS/js/default.js b/files/assets/CHRISTMAS/js/default.js
index d4c262420..f86474e4f 100644
--- a/files/assets/CHRISTMAS/js/default.js
+++ b/files/assets/CHRISTMAS/js/default.js
@@ -255,13 +255,11 @@ function submitFormAjax(e, success, error) {
var myToast = new bootstrap.Toast(document.getElementById('toast-post-success'));
myToast.show();
// Run success function
- success()
+ if (success) success()
return true
} else if (xhr.status >= 300 && xhr.status < 400) {
window.location.href = JSON.parse(xhr.response)["redirect"]
} else {
- // Run error function
- error()
try {
data=JSON.parse(xhr.response);
var myToast = new bootstrap.Toast(document.getElementById('toast-post-error'));
@@ -275,6 +273,8 @@ function submitFormAjax(e, success, error) {
myToast.show();
return false
}
+ // Run error function
+ if (error) error()
}
};
diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html
index e48d8463c..66ddd6833 100644
--- a/files/templates/CHRISTMAS/default.html
+++ b/files/templates/CHRISTMAS/default.html
@@ -357,7 +357,7 @@
}
{% endif %}
-
+