forms.CheckboxSelectMultiple does not render properly #11058

Closed
opened 2025-12-29 21:39:43 +01:00 by adam · 2 comments
Owner

Originally created by @madgrizzle on GitHub (Apr 19, 2025).

Deployment Type

Self-hosted

NetBox Version

v4.2.5

Python Version

3.10

Steps to Reproduce

I am implementing a FilterForm and want to provide the user with a list of "ratings" that it can select to filter on. I use thed following form field and forms.CheckboxSelectMultiple widget. but it doesn't render properly (either Chrome of Firefox)

rating = forms.MultipleChoiceField(
        choices=[(str(i), f"Rating: {i}") for i in range(1, 6)],
        required=False,
        widget=forms.CheckboxSelectMultiple,
        label=_('Rating'),
)

Expected Behavior

The widget should have rendered properly and clicking on a checkbox should result in a visual indication that the checkbox is checked.

Observed Behavior

The widget should have rendered properly but instead, it produces the following and clicking the buttons doesn't check them visually. It does send to proper ratings to be used in the filter, but the rendering is broken. This image is with multiple checkboxes actually clicked.

Image

I couldn't find a netbox-specific equivalent widget in the code.

Originally created by @madgrizzle on GitHub (Apr 19, 2025). ### Deployment Type Self-hosted ### NetBox Version v4.2.5 ### Python Version 3.10 ### Steps to Reproduce I am implementing a FilterForm and want to provide the user with a list of "ratings" that it can select to filter on. I use thed following form field and forms.CheckboxSelectMultiple widget. but it doesn't render properly (either Chrome of Firefox) ``` rating = forms.MultipleChoiceField( choices=[(str(i), f"Rating: {i}") for i in range(1, 6)], required=False, widget=forms.CheckboxSelectMultiple, label=_('Rating'), ) ``` ### Expected Behavior The widget should have rendered properly and clicking on a checkbox should result in a visual indication that the checkbox is checked. ### Observed Behavior The widget should have rendered properly but instead, it produces the following and clicking the buttons doesn't check them visually. It does send to proper ratings to be used in the filter, but the rendering is broken. This image is with multiple checkboxes actually clicked. ![Image](https://github.com/user-attachments/assets/f2bca10d-3de3-474d-ac96-133c77743293) I couldn't find a netbox-specific equivalent widget in the code.
adam added the type: bug label 2025-12-29 21:39:43 +01:00
adam closed this issue 2025-12-29 21:39:43 +01:00
Author
Owner

@arthanson commented on GitHub (Apr 21, 2025):

@madgrizzle This is not a bug in NetBox as you are implementing your own code, this is more of a general Django question. Can you please open this as a discussion, you should receive more answers that way. Closing this issue.

@arthanson commented on GitHub (Apr 21, 2025): @madgrizzle This is not a bug in NetBox as you are implementing your own code, this is more of a general Django question. Can you please open this as a discussion, you should receive more answers that way. Closing this issue.
Author
Owner

@madgrizzle commented on GitHub (Apr 21, 2025):

Thanks, I assumed it was related to something with netbox's use of bootstrap or something.

@madgrizzle commented on GitHub (Apr 21, 2025): Thanks, I assumed it was related to something with netbox's use of bootstrap or something.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#11058