Unable to programmatically undo/remove readonly property on fields
Given I have code like the following in Document Javascript:
function ReadOnly() {
var theOption = this.getField("option5");
var theField = this.getField("text57");
theField.readonly = !(theOption.value && theOption.value == "Choice1");
}
ReadOnly();This code will successfully set fields to being read-only, but the opposite doesn't work. It's as if setting readonly to false doesn't have any effect.
Just to make sure, I tried variants of this, such as the following, but it doesn't change the fact that setting a field's readonly property back to false doesn't have any effect. The field stays read-only once the property has been set to true.
function ReadOnly() {
var theOption = this.getField("option5");
var theField = this.getField("text57");
if (theOption.value && theOption.value == "Choix1") {
theField.readonly = false;
} else {
theField.readonly = true;
}
}
ReadOnly();