This topic is locked
[SOLVED]

 Set Values to read only instead of disabled

11/22/2011 5:53:59 PM
PHPRunner General questions
S
stiven author

Hello,
i used this code to get the value of the field when the value = lock then all the fields are set to disabled, but i need to be able to copy and paste the info so i was wondering if there is a way to set the fields as read only instead of setting them as disabled? i was looking through the manual but didn't find a way to do this.. thanks



var lock = Runner.getControl(pageid, 'lock');

var lock_value = lock.getValue();
if(lock_value == 'Lock'){
var recCtrlsArr = Runner.controls.ControlManager.getAt('vital_info');
for(var i=0;i<recCtrlsArr.length;i++)

{

var ctrl = recCtrlsArr[i];

ctrl.setDisabled();

}
}
S
stiven author 11/22/2011



Hello,
i used this code to get the value of the field when the value = lock then all the fields are set to disabled, but i need to be able to copy and paste the info so i was wondering if there is a way to set the fields as read only instead of setting them as disabled? i was looking through the manual but didn't find a way to do this.. thanks



var lock = Runner.getControl(pageid, 'lock');

var lock_value = lock.getValue();
if(lock_value == 'Lock'){
var recCtrlsArr = Runner.controls.ControlManager.getAt('vital_info');
for(var i=0;i<recCtrlsArr.length;i++)

{

var ctrl = recCtrlsArr[i];

ctrl.setDisabled();

}
}



Never Mind sorry my bad i just saw it in the manual ctrl.makeReadonly();
thanks