diff --git a/netbox/project-static/dist/netbox.js b/netbox/project-static/dist/netbox.js index e9e9da59d..d86103d2a 100644 Binary files a/netbox/project-static/dist/netbox.js and b/netbox/project-static/dist/netbox.js differ diff --git a/netbox/project-static/dist/netbox.js.map b/netbox/project-static/dist/netbox.js.map index 7c8a8866e..76cd496f3 100644 Binary files a/netbox/project-static/dist/netbox.js.map and b/netbox/project-static/dist/netbox.js.map differ diff --git a/netbox/project-static/src/forms/elements.ts b/netbox/project-static/src/forms/elements.ts index 356a8d51e..e047ea738 100644 --- a/netbox/project-static/src/forms/elements.ts +++ b/netbox/project-static/src/forms/elements.ts @@ -39,10 +39,17 @@ export function initFormElements(): void { // Find each of the form's submitters. Most object edit forms have a "Create" and // a "Create & Add", so we need to add a listener to both. const submitters = form.querySelectorAll('button[type=submit]'); - for (const submitter of submitters) { // Add the event listener to each submitter. submitter.addEventListener('click', (event: Event) => handleFormSubmit(event, form)); } + + // Initialize any reset buttons so that when clicked, the page is reloaded without query parameters. + const resetButton = document.querySelector('button[data-reset-select]'); + if (resetButton !== null) { + resetButton.addEventListener('click', () => { + window.location.assign(window.location.origin + window.location.pathname); + }); + } } }