This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

Making a input text field readonly..

Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,
I am trying to make a text input field in a form readonly when I select a particular radio button.
I used the foll. code to for this functionlity:
function changeTextField(typeOfRadioButtonClicked){
if(typeOfRadioButtonClicked == 1){
document.<formName>.<fieldName>.readOnly = true;
else if(typeOfRadioButtonClicked == 2){
document.<formName>.<fieldName>.readOnly = false;
I do not want to disable this text input field as I need to send these value to the server for further processing.
This works perfectly fine in IE but does not work in Netscape.
Can anybody give me hints as to how I can this functionality in Netscape?
Thank you
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can only think of one "messy" way...that is to fire a focus event on each textfield, then set a variable from the radio button event so you can check against it with the focus event. Then you could just blur them out of the textfield. Ugly but it would probably work.
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use this ..
<input type=text name=txtfld onFocus="blur()">

This will solve your problem
She said she got a brazillian. I think owning people is wrong. That is how I learned ... tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!