467,885 Members | 1,292 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,885 developers. It's quick & easy.

Readonly

I have an input box which is created with the readonly option included. Is
it possible to turn this off.

This is so the input box is not selectable untill a radio button is switched
on.

I have tried form.ip.readonly = false, but this doesn't work

Thanks


Jul 23 '05 #1
  • viewed: 16442
Share:
3 Replies


Hamish wrote:
I have an input box which is created with the readonly option included. Is
it possible to turn this off.

This is so the input box is not selectable untill a radio button is switched
on.

I have tried form.ip.readonly = false, but this doesn't work


Case is important, the name of that property is readOnly and not readonly:
http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-88461592
so try
<input type="radio"
onclick="if (this.checked) {
this.form.elements.inputName.readOnly = false;
}">

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
On Fri, 19 Nov 2004 12:20:35 +0000 (UTC), Hamish wrote:
I have an input box which is created with the readonly option included. Is
it possible to turn this off.


....
<form action='get'>
<input type='text' disabled id='tf' value='Hello!'>
<input type='button'
onclick='document.getElementById("tf").disabled=fa lse;'
value='Enable'>
....

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
Jul 23 '05 #3
Thanks

Jul 23 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Darshak Shah | last post: by
4 posts views Thread by harry | last post: by
3 posts views Thread by Michael SL | last post: by
4 posts views Thread by Doug Bell | last post: by
7 posts views Thread by Jimbo | last post: by
2 posts views Thread by J. McConnell | last post: by
10 posts views Thread by sunil | last post: by
reply views Thread by MrMoon | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.