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: Tue Jan 31 2006 - 19:55:11 CET

BootNic wrote on 31 jan 2006 in comp.lang.javascript:

> <button type="button" onclick="x.readOnly=(x.readOnly)?false:true;
> x.focus(); x.select();">toggle readOnly</button>
>

A <button> is always a button.

onclick="x.readOnly=!x.readOnly;"

try:

==============
<input id='x' readonly>

<script type="text/javascript">
var x = document.getElementById('x')
</script>
 
<button type="button"
onclick="x.readOnly=!x.readOnly;">
toggle readOnly</button>
===============

Indeed it works!

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