How to revert the readonly attribute on an input box?
I am able to set the readonly property for an input ui control. I need to make it read-write on a button click (on an event). I am unable to revert it back.
Can somebody help me on this? Please treat this as an urgent request. I think this a very primitive requirement and I think I am missing something here. Below is the sample code:
var obj = new AW.UI.Input;
obj.setId("myInput");
obj.setAttribute("disabled","true");
obj.getContent('box/text').setAttribute('readonly', 'readonly');
obj.setControlText("Some text");
document.write(obj);
var button1 = new AW.UI.Button;
button1.setControlSize(90);
button1.setControlText("Enable edit");
button1.onControlClicked = function(event){
obj.setAttribute("disabled",null);
obj.getContent('box/text').setAttribute('readonly','');
obj.refresh();
}
document.write(button1);
--thank you
Can somebody help me on this? Please treat this as an urgent request. I think this a very primitive requirement and I think I am missing something here. Below is the sample code:
var obj = new AW.UI.Input;
obj.setId("myInput");
obj.setAttribute("disabled","true");
obj.getContent('box/text').setAttribute('readonly', 'readonly');
obj.setControlText("Some text");
document.write(obj);
var button1 = new AW.UI.Button;
button1.setControlSize(90);
button1.setControlText("Enable edit");
button1.onControlClicked = function(event){
obj.setAttribute("disabled",null);
obj.getContent('box/text').setAttribute('readonly','');
obj.refresh();
}
document.write(button1);
--thank you
Prasad
July 26,