diff --git a/html/includes/functions.inc.php b/html/includes/functions.inc.php
index 2397db040..dbc757d5f 100644
--- a/html/includes/functions.inc.php
+++ b/html/includes/functions.inc.php
@@ -1257,7 +1257,7 @@ function generate_dynamic_config_panel($title, $config_groups, $items = array(),
if ($item['type'] == 'checkbox') {
$output .= '<input id="' . $item['name'] . '" type="checkbox" name="global-config-check" ' . $config_groups[$item['name']]['config_checked'] . ' data-on-text="Yes" data-off-text="No" data-size="small" data-config_id="' . $config_groups[$item['name']]['config_id'] . '">';
} elseif ($item['type'] == 'text') {
- $pattern = isset($item['pattern']) ? ' pattern="' . $item['pattern'] . '"' : "";
+ $pattern = isset($item['pattern']) ? ' required pattern="' . $item['pattern'] . '"' : "";
$output .= '
<input id="' . $item['name'] . '" class="form-control validation" type="text" name="global-config-input" value="' . $config_groups[$item['name']]['config_value'] . '" data-config_id="' . $config_groups[$item['name']]['config_id'] . '"' . $pattern . '>
diff --git a/html/js/librenms.js b/html/js/librenms.js
index 36cc12c2c..927b3dcc2 100644
--- a/html/js/librenms.js
+++ b/html/js/librenms.js
@@ -87,22 +87,25 @@ $(document).ready(function() {
var $this = $(this);
var config_id = $this.data("config_id");
var config_value = $this.val();
- $.ajax({
- type: 'POST',
- url: 'ajax_form.php',
- data: {type: "update-config-item", config_id: config_id, config_value: config_value},
- dataType: "json",
- success: function (data) {
- if (data.status == 'ok') {
- toastr.success('Config updated');
- } else {
+ var required = $this.prop('required');
+ if (required == false) {
+ $.ajax({
+ type: 'POST',
+ url: 'ajax_form.php',
+ data: {type: "update-config-item", config_id: config_id, config_value: config_value},
+ dataType: "json",
+ success: function (data) {
+ if (data.status == 'ok') {
+ toastr.success('Config updated');
+ } else {
+ toastr.error(data.message);
+ }
+ },
+ error: function () {
toastr.error(data.message);
}
- },
- error: function () {
- toastr.error(data.message);
- }
- });
+ });
+ }
});
// Select config ajax calls