[PR #20401] [MERGED] Fixes #20398: Rely on browser-native form field validation #15916

Closed
opened 2025-12-30 00:24:47 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20401
Author: @jeremystretch
Created: 9/19/2025
Status: Merged
Merged: 9/19/2025
Merged by: @jnovinger

Base: mainHead: 20398-foem-field-validation


📝 Commits (1)

  • 1af16fa Fixes #20398: Rely on browser-native form field validation

📊 Changes

5 files changed (+12 additions, -47 deletions)

View changed files

📝 netbox/project-static/dist/netbox.js (+4 -4)
📝 netbox/project-static/dist/netbox.js.map (+3 -3)
📝 netbox/project-static/src/forms/elements.ts (+5 -35)
📝 netbox/templates/dcim/htmx/cable_edit.html (+0 -1)
📝 netbox/utilities/templates/form_helpers/render_field.html (+0 -4)

📄 Description

Fixes: #20398

  • Remove the TypeScript which applies the is-invalid CSS class to form fields with invalid values on form submit
  • Remove the call to event.preventDefault() to allow the native browser validation to take over
  • Remove the now-obsolete generic "This field is required" warning from the form template

🔄 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/20401 **Author:** [@jeremystretch](https://github.com/jeremystretch) **Created:** 9/19/2025 **Status:** ✅ Merged **Merged:** 9/19/2025 **Merged by:** [@jnovinger](https://github.com/jnovinger) **Base:** `main` ← **Head:** `20398-foem-field-validation` --- ### 📝 Commits (1) - [`1af16fa`](https://github.com/netbox-community/netbox/commit/1af16fab46735861b3ada222b3dd430d6abab09d) Fixes #20398: Rely on browser-native form field validation ### 📊 Changes **5 files changed** (+12 additions, -47 deletions) <details> <summary>View changed files</summary> 📝 `netbox/project-static/dist/netbox.js` (+4 -4) 📝 `netbox/project-static/dist/netbox.js.map` (+3 -3) 📝 `netbox/project-static/src/forms/elements.ts` (+5 -35) 📝 `netbox/templates/dcim/htmx/cable_edit.html` (+0 -1) 📝 `netbox/utilities/templates/form_helpers/render_field.html` (+0 -4) </details> ### 📄 Description ### Fixes: #20398 - Remove the TypeScript which applies the `is-invalid` CSS class to form fields with invalid values on form submit - Remove the call to `event.preventDefault()` to allow the native browser validation to take over - Remove the now-obsolete generic "This field is required" warning from the form template --- <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-30 00:24:47 +01:00
adam closed this issue 2025-12-30 00:24:47 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#15916