Copy link to clipboard
Copied
I'm programmatically setting the readonly property on fields of type checkbox to true, but that doesn't seem to have any effect. Checkboxes stay checkable. The only thing that works is to uncheck them.
I have not found any evidence in the docs that checkboxes not being "readonly"-able should be the desired behavior for checkboxes, is it?
Copy link to clipboard
Copied
Where does you set the property?
Copy link to clipboard
Copied
Similar to my question in my other post , I'm setting the propery in Document Javascript. E.g. using the following function:
function controlFieldIsSet(field) {
return field.value == "Choix2" || field.value == "Choix3";
}
function readonlyapep() {
var controlfield1 = this.getField('option39');
var controlfield2 = this.getField('option40');
for (var i = 0; i < this.numFields; i++) {
var field = this.getField(this.getNthFieldName(i));
if (field.name.indexOf("apep_") > -1) {
if (controlFieldIsSet(controlfield1) || controlFieldIsSet(controlfield2)) {
field.readonly = false;
} else {
field.readonly = true;
}
}
}
}
readonlyapep();
I also tried setting readonly to false from the Action of another form field, with the same effect.
Copy link to clipboard
Copied
At document level it will execute the script at document open.
Copy link to clipboard
Copied
Are any errors reported in the Console Window?
Are you sure that the readOnly property is being set?
Have you tested it from the console?
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more