-
Notifications
You must be signed in to change notification settings - Fork 1
Description
This is the case with Icinga\Web\Form and for good reason. Which is: A disabled element is not transferred by a browser. If no value is sent, the default is left unchanged and that is what is expected.
Under normal circumstances, while the element in the DOM is indeed disabled, this works fine already. While the user can manipulate the DOM, and enable the element, this isn't the main problem: If there's autosubmit functionality in the form, the disabled element might have been enabled prior submission. In this case the browser is transferring the value but if the submission results in a change of the form's elements, and the element in question is disabled, it accepts the previous value and overrides the default.
The only way to solve this at the moment, is to explicitly clear the populated value before registering the disabled element.
This should not be necessary and work by default the same as in Icinga\Web\Form.
I'm not saying disabled elements should never accept a new value. (Block or ignore calls to setValue()) But populated values must not be set.