Re: Making a HTML text field readonly

Mukul Gandhi <mukulw3@yahoo.com> wrote:

> I want to make a HTML text field read only.
> But it works in IE 5 and not in Netscape 4.51.

You can't do it with HTML in NN4, but there are some
JavaScript hacks. By tradition, onfocus="this.blur();",
but this makes keyboard navigation difficult. Alternatives
include onchange/onsubmit events to set the content back
to what it was, and timeouts to do same.

If possible it's best to avoid the problem by not using
form elements for immutable content, or not caring if
they are changed. I don't know what your situation is
though.

-- 
Andrew Clover
Technical Consultant
1VALUE.com AG

Received on Tuesday, 13 March 2001 05:03:04 UTC