From eeb07535ad568b4bab2c344a770de5fbf3ff0836 Mon Sep 17 00:00:00 2001 From: RD WebDesign Date: Tue, 14 Nov 2023 19:58:41 -0300 Subject: [PATCH] Clear input fields after successfully adding new items Applies to Clients, Domains and Lists. --- scripts/pi-hole/js/groups-clients.js | 1 + scripts/pi-hole/js/groups-domains.js | 4 ++++ scripts/pi-hole/js/groups-lists.js | 2 ++ 3 files changed, 7 insertions(+) diff --git a/scripts/pi-hole/js/groups-clients.js b/scripts/pi-hole/js/groups-clients.js index a0d8faea..ea27f602 100644 --- a/scripts/pi-hole/js/groups-clients.js +++ b/scripts/pi-hole/js/groups-clients.js @@ -459,6 +459,7 @@ function addClient() { utils.enableAll(); utils.listsAlert("client", ips, data); reloadClientSuggestions(); + $("#new_comment").val(""); table.ajax.reload(null, false); table.rows().deselect(); diff --git a/scripts/pi-hole/js/groups-domains.js b/scripts/pi-hole/js/groups-domains.js index c430e560..6e62f7d2 100644 --- a/scripts/pi-hole/js/groups-domains.js +++ b/scripts/pi-hole/js/groups-domains.js @@ -553,6 +553,10 @@ function addDomain() { success: function (data) { utils.enableAll(); utils.listsAlert("domain", domains, data); + $("#new_domain").val(""); + $("#new_domain_comment").val(""); + $("#new_regex").val(""); + $("#new_regex_comment").val(""); table.ajax.reload(null, false); table.rows().deselect(); diff --git a/scripts/pi-hole/js/groups-lists.js b/scripts/pi-hole/js/groups-lists.js index cf859a9c..c0768501 100644 --- a/scripts/pi-hole/js/groups-lists.js +++ b/scripts/pi-hole/js/groups-lists.js @@ -529,6 +529,8 @@ function addList(event) { success: function (data) { utils.enableAll(); utils.listsAlert("list", addresses, data); + $("#new_address").val(""); + $("#new_comment").val(""); table.ajax.reload(null, false); table.rows().deselect();