Open bwl21 opened 11 years ago
The problem with the readonly attribute is, that we cannot make sure, that the user does not change the value (by removing the attribute or changing its value directly). So to make readonly work as intended, the input in depage-forms should then also be readonly, e.g. not get its data from the POST.
The question is: What do you need the only attribute for. If you just want to display data, just use the addHtml-method, its safer and no data will be submitted.
The only sense of the readonly-attribute for me is as a user-hint, usually set with javascript, when an action or a data entry is not available yet.
So when we implemented depage-forms, Sebastian asked we about the attribute and I told him to leave it out (for the time being).
What would be your use-case?
hi,
our uscase is, that we do a course registration form, where the course data is provided by the website and should not be changed by the visitor. On the other hand the subsequent processing shold also get the course data as regular form fields.
A third usecase is, that the form is invoked without a course known (maybye the curse is for what ever reason notnnounced by the website but on other channels.) In this case the user should be able to fill the fields.
Also the information should be presented the same way regardelss if prefilled or filled by the user. This would be much effort e.g. with checkboxers etc.
But the major thing is, that our subsequent processing should expose the fields as any other form information.
In any case the form visualization and subsequent processing would be the same all the time. Also our formsdriver only needs to set the attribute but not to emit entirely different elements.
This cannot be achieved with html text ( whcih has no value). Isn't there readonly attribute in HTML4 which could be used for this.?
It would be sufficient (but maybe even more difficult) if a fieldset can be set to readonly.
I hope the clarifies our usecase.
Thanks for asking.
-b
How can we create an input field which is readonly. This allows to display fields in a form which are prefilled, and cannot be changed by the visitor.
But the subsequent processing of the form would handle these fields as any other.
We tried to use disabled => true. It seemed to work until we found out that by switching steps, disabled fields are cleared.