Javascript is unable to disable the dynamicmodelform field #6248

Closed
opened 2025-12-29 19:38:28 +01:00 by adam · 2 comments
Owner

Originally created by @leerobertsprojects on GitHub (Mar 22, 2022).

NetBox version

v3.1.9

Python version

3.8

Steps to Reproduce

I have some JavaScript code embedded in a html page which disables and enables some fields depending on whether a checkbox is ticked or not
image

on the webpage the initial forms are greyed out but when the box is ticked, the VLAN field does not disable and the other fields do not re-enable

Expected Behavior

When the box is ticked the fields enable and disable depending on the state of the box

Observed Behavior

the fields remain in there current state after ticking the box and the DynamicModelFormField wont disable at all.

image

image

i have added in console logs so i know the event is firing and the attributes are being set and removed but still no change on the page.

Originally created by @leerobertsprojects on GitHub (Mar 22, 2022). ### NetBox version v3.1.9 ### Python version 3.8 ### Steps to Reproduce I have some JavaScript code embedded in a html page which disables and enables some fields depending on whether a checkbox is ticked or not ![image](https://user-images.githubusercontent.com/59196961/159477267-d793438e-64aa-47b4-ba73-bdb51f15d77d.png) on the webpage the initial forms are greyed out but when the box is ticked, the VLAN field does not disable and the other fields do not re-enable ### Expected Behavior When the box is ticked the fields enable and disable depending on the state of the box ### Observed Behavior the fields remain in there current state after ticking the box and the DynamicModelFormField wont disable at all. ![image](https://user-images.githubusercontent.com/59196961/159477903-3cc613aa-dd70-4e0a-b98e-72cb1e214f47.png) ![image](https://user-images.githubusercontent.com/59196961/159478191-59246920-153c-4bbd-82a6-eb5dbefa1e8e.png) i have added in console logs so i know the event is firing and the attributes are being set and removed but still no change on the page.
adam added the type: bug label 2025-12-29 19:38:28 +01:00
adam closed this issue 2025-12-29 19:38:28 +01:00
Author
Owner

@jeremystretch commented on GitHub (Mar 22, 2022):

I have some JavaScript code embedded in a html page which disables and enables some fields depending on whether a checkbox is ticked or not

Bug reports are accepted only if they can be replicated on a current release without modification. If you need help with custom development, consider opening a discussion.

@jeremystretch commented on GitHub (Mar 22, 2022): >I have some JavaScript code embedded in a html page which disables and enables some fields depending on whether a checkbox is ticked or not Bug reports are accepted only if they can be replicated on a current release without modification. If you need help with custom development, consider opening a [discussion](https://github.com/netbox-community/netbox/discussions/new).
Author
Owner

@leerobertsprojects commented on GitHub (Mar 22, 2022):

Ok thanks ill do that.

@leerobertsprojects commented on GitHub (Mar 22, 2022): Ok thanks ill do that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#6248