PDA

View Full Version : apply readonly option & remove it



ishakya
14 Jun 2011, 4:21 AM
Hi all,

I need to remove read only option to a set of text boxes when a check box is checked.I have done that part.But i want to apply read only option again when earlier check box is unchecked.

Here is the code to remove read only.





function closeObject(someID,someID1,someID2,someID3)
{
document.getElementById(someID).removeAttribute('readonly');
document.getElementById(someID1).removeAttribute('readonly');
document.getElementById(someID2).removeAttribute('readonly');
document.getElementById(someID3).removeAttribute('readonly');

//document.getElementById(someID).value ='NEW';

}
So i need to apply read only again when the check box is unchecked.


Need a quick response please!!!!!!!!

Uberdude
14 Jun 2011, 5:24 AM
You appear to just be writing regular DOM manipulation javascript, rather than using Ext. If you use Ext it is easy:


myTextField.setReadOnly(true);