Friday, July 13, 2007

ReadOnly and Disabled fields

In HTML, we have two options if we want non-editable fields. Mark the fields as readonly or make them disabled.

The difference between the two is that a diabled field is not send as a HTTP parameter to the server when the form is submitted, whereas a readonly field is send back to the server.
This may be important when you use frameworks such as Struts where the formbeans may expect nested properties to come back to the server.

No comments:

Post a Comment