Opened 4 years ago

Last modified 4 years ago

#31294 closed Bug

Disabled (hidden) inputs don't transmit their data — at Initial Version

Reported by: berzi Owned by: nobody
Component: Forms Version: 3.0
Severity: Normal Keywords: forms, hidden, input, get, post
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

It seems that hidden inputs (in my case I tried with a CharField and an EmailField, both with a HiddenInput as widget) "refuse" to transmit their data through the form if they are disabled.

It's possible that this happens with all disabled fields, and that it doesn't happen if the field has an initial value set on declaration, but initial values set at runtime get thrown away, and not all use-cases allow the initial value to be assigned on class declaration (for example, data from a request needs to be obtained at runtime).

The problem and a few test scenarios are outlined in [this SO question](https://stackoverflow.com/questions/60322334/way-to-pass-information-from-a-get-parameter-to-a-post-form-in-django).

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top