Re: Next form element
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.javascript archive

Re: Next form element

From: Evertjan. <exjxw.hannivoort@interxnl.net>
Date: Mon Jan 30 2006 - 18:11:18 CET

Christoph wrote on 30 jan 2006 in comp.lang.javascript:

> I know I can do
> this by setting the form element to 'readonly' but that's not possible
> as I'll need to modify that value elsewhere in my JS.

1 you can write the value of a readonly <input> element with javascript

2 you cannot change the readonlyness of an <input> element with javascript

3 however, you can use "disabled" to your advantage.

<input id=x disabled>

<script type="text/javascript">
 var x = document.getElementById('x')
 x.value = 'hi world'
 alert(x.disabled)
 x.disabled = false
</script>

Do not mess with focus() to restrain the user!

-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Received on Tue Feb 7 21:27:38 2006