#31294: Disabled (hidden) inputs don't transmit their data
-------------------------------------+-------------------------------------
Reporter: berzi | Owner: nobody
Type: Bug | Status: new
Component: Forms | Version: 3.0
Severity: Normal | Keywords: forms, hidden,
Triage Stage: | input, get, post
Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
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).
--
Ticket URL: <https://code.djangoproject.com/ticket/31294>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/048.9ef219058fc2783314edc7d54ce174c2%40djangoproject.com.