diff --git a/html/forms/create-alert-item.inc.php b/html/forms/create-alert-item.inc.php index e11c56124..152733d2c 100644 --- a/html/forms/create-alert-item.inc.php +++ b/html/forms/create-alert-item.inc.php @@ -27,7 +27,7 @@ $invert = mres($_POST['invert']); $name = mres($_POST['name']); if(empty($rule)) { - $update_message = "ERROR: No rule was generated"; + $update_message = "ERROR: No rule was generated - did you forget to click and / or?"; } elseif(validate_device_id($_POST['device_id']) || $_POST['device_id'] == '-1' || $_POST['device_id'][0] == ':') { $device_id = $_POST['device_id']; if(!is_numeric($count)) { diff --git a/html/includes/modal/new_alert_rule.inc.php b/html/includes/modal/new_alert_rule.inc.php index 59f464e3b..e7d050173 100644 --- a/html/includes/modal/new_alert_rule.inc.php +++ b/html/includes/modal/new_alert_rule.inc.php @@ -32,6 +32,11 @@ if(is_admin() !== false) { +
+
+ +
+
@@ -329,18 +334,19 @@ $('#rule-submit').click('', function(e) { url: "/ajax_form.php", data: $('form.alerts-form').serialize(), success: function(msg){ - $("#message").html('
'+msg+'
'); - $("#create-alert").modal('hide'); if(msg.indexOf("ERROR:") <= -1) { + $("#message").html('
'+msg+'
'); + $("#create-alert").modal('hide'); $('#response').data('tagmanager').empty(); setTimeout(function() { location.reload(1); }, 1000); + } else { + $('#ajax_response').html('
'+msg+'
'); } }, error: function(){ - $("#message").html('
An error occurred creating this alert.
'); - $("#create-alert").modal('hide'); + $("#ajax_response").html('
An error occurred creating this alert.
'); } }); });