Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

need readonly attribute #6

Open
bwl21 opened this issue Sep 16, 2013 · 2 comments
Open

need readonly attribute #6

bwl21 opened this issue Sep 16, 2013 · 2 comments

Comments

@bwl21
Copy link
Contributor

bwl21 commented Sep 16, 2013

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.

@jonasjonas
Copy link
Member

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?

@bwl21
Copy link
Contributor Author

bwl21 commented Sep 20, 2013

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants