diff --git a/scripts/pi-hole/js/customcname.js b/scripts/pi-hole/js/customcname.js index 09556695..e78e4a7e 100644 --- a/scripts/pi-hole/js/customcname.js +++ b/scripts/pi-hole/js/customcname.js @@ -87,6 +87,10 @@ function addCustomCNAME() { "Custom CNAME added", domain + ": " + target ); + + // Clean up field values and reload table data + $("#domain").val(""); + $("#target").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message); @@ -120,6 +124,10 @@ function deleteCustomCNAME() { "Custom CNAME deleted", domain + ": " + target ); + + // Clean up field values and reload table data + $("#domain").val(""); + $("#target").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message); diff --git a/scripts/pi-hole/js/customdns.js b/scripts/pi-hole/js/customdns.js index 5043520b..865f54b0 100644 --- a/scripts/pi-hole/js/customdns.js +++ b/scripts/pi-hole/js/customdns.js @@ -81,6 +81,10 @@ function addCustomDNS() { utils.enableAll(); if (response.success) { utils.showAlert("success", "far fa-check-circle", "Custom DNS added", domain + ": " + ip); + + // Clean up field values and reload table data + $("#domain").val(""); + $("#id").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message); @@ -109,6 +113,10 @@ function deleteCustomDNS() { utils.enableAll(); if (response.success) { utils.showAlert("success", "far fa-check-circle", "Custom DNS deleted", domain + ": " + ip); + + // Clean up field values and reload table data + $("#domain").val(""); + $("#id").val(""); table.ajax.reload(); } else { utils.showAlert("error", "fas fa-times", "Failure! Something went wrong", response.message);