View Full Version : read only attribute
Is there a way to set the readonly attribute of an inpu field? Here is my current code(all of the names are correct):
document.forms[0].address1HO.readonly = "true";
there seems to be a way of using the onfocus="this.blur()" idea, however, I do not know how to apply this to what I am doing. I want the text input field to be readonly if the user selects a checkbox.
I do not want it to be disabled.
SO i figue that there could be a way to make the text input field readonly by javascript, but cannot figure it out for the life of me
IKLOP
08-17-2004, 12:54 AM
I think this would work:<input type="text" onfocus="if( document.forms[0].checkboxname.checked ) this.blur();">
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.