If so, how ?
Cheers
Dave
> Is it possible to dynamically make a form text box readonly in NN4+ ?
You cannot do anything dynamic in HTML, to begin with.
And NN 4 doesn't support the READONLY attribute or corresponding
features in the "document object model", i.e. you can't set anything
equivalent in a scripting language either.
You could use JavaScript to modify things so that the box loses focus
when focused on, but this a) works only when JavaScript is enabled,
b) isn't really equivalent to READONLY. cf. to
http://www.cs.tut.fi/~jkorpela/forms/readonly.html
As usual in dead end situations, it is best to track back to the point
where you had a problem that you tried to solve in a particular way,
and try and find a different approach.
--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>"Dave S" <dave_s...@hotmail.com> wrote:
>
>> Is it possible to dynamically make a form text box readonly in NN4+ ?
>
>You cannot do anything dynamic in HTML, to begin with.
>
>You could use JavaScript to modify things so that the box loses focus
>when focused on, but this a) works only when JavaScript is enabled,
And you can in most implementations still "paste" into the box, e.g.
on windows highlight any contents that are still there, "right click"
and select paste. - This is in addition to any javascript approach.
>b) isn't really equivalent to READONLY. cf. to
>http://www.cs.tut.fi/~jkorpela/forms/readonly.html
This from the above page is unsafe, and not per any standard DOM and
is definately unsupported in some
this.form.fld3.focus()
use
document.forms['formname'].elements['fld3].focus()
and only then you're making the assumption that focus, and form
elements are exposed, this is probably a pretty safe assumption inside
an onfocus event handler, but you may want to take precautions if you
like braces with your belt.
It also certainly doesn't work on "all JavaScript enabled browsers"
but as you're saying not 100% the rarities are probably ok to ignore.
>As usual in dead end situations, it is best to track back to the point
>where you had a problem that you tried to solve in a particular way,
>and try and find a different approach.
Naturally.
Jim.