Problems with readonly attributes

Hi all,

I have an editing form in which only one field must be editable;the
other ones being readonly.Is there some way to automatize it,so I don´t
have to modify all fields by hand?

Thanks,
Rafael R.

Rafael R. wrote:

Hi all,

I have an editing form in which only one field must be editable;the
other ones being readonly.Is there some way to automatize it,so I don´t
have to modify all fields by hand?

Thanks,
Rafael R.

why not disable that field in the form using javascript

and define few callback like before_create that can set the value of
that field to the default if field is subjected to modifications by
turning off javascript in the browser or through any other techniques

On Jul 21, 1:51 pm, Virendra N. [email protected]
wrote:

why not disable that field in the form using javascript
No! That will fail – and leave the field editable – if JavaScript
is turned off.

In general, there is almost never a good reason to use a read-only
field. If the data is not editable, just put it on the page as plain
text.

If there’s some other issue, please explain in more detail.

Best,

Marnen Laibow-Koser
http://www.marnen.org
[email protected]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs