[PR #13963] [MERGED] Fixes #13064: Ensure unchecked checkboxes do not revert to original values upon HTMX form refresh #14291

Closed
opened 2025-12-29 23:23:38 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/13963
Author: @jeremystretch
Created: 10/3/2023
Status: Merged
Merged: 10/4/2023
Merged by: @jeremystretch

Base: developHead: 13064-htmx-checkboxes


📝 Commits (1)

  • 4bbb4d9 Fixes #13064: Ensure unchecked checkboxes do not revert to original values upon HTMX form refresh

📊 Changes

2 files changed (+10 additions, -0 deletions)

View changed files

📝 netbox/netbox/settings.py (+4 -0)
netbox/templates/django/forms/widgets/checkbox.html (+6 -0)

📄 Description

Fixes: #13064

  • Set FORM_RENDERER to TemplatesSetting, which allows overriding Django's stock form widget HTML templates
  • Embed a hidden form element above each checkbox widget to ensure an empty field value is sent for unchecked checkboxes as part of the form data

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/13963 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 10/3/2023 **Status:** ✅ Merged **Merged:** 10/4/2023 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `develop` ← **Head:** `13064-htmx-checkboxes` --- ### 📝 Commits (1) - [`4bbb4d9`](https://github.com/netbox-community/netbox/commit/4bbb4d9c1b44a8b2f9960af18c1dd82366e0f0e4) Fixes #13064: Ensure unchecked checkboxes do not revert to original values upon HTMX form refresh ### 📊 Changes **2 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `netbox/netbox/settings.py` (+4 -0) ➕ `netbox/templates/django/forms/widgets/checkbox.html` (+6 -0) </details> ### 📄 Description ### Fixes: #13064 - Set `FORM_RENDERER` to `TemplatesSetting`, which allows overriding Django's stock form widget HTML templates - Embed a hidden form element above each checkbox widget to ensure an empty field value is sent for unchecked checkboxes as part of the form data --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-29 23:23:38 +01:00
adam closed this issue 2025-12-29 23:23:39 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#14291