AEM Form:更改文本字段的访问控制
AEM Form: Change access control of textfield
我正在使用 Adobe AEM Form,javascript 编写脚本。
在我的表单中,我有一个下拉菜单,允许用户选择一个下拉值项目或通过键入来填充文本字段。我的脚本如下:
Report.Page2.part2.body.subform.Dropdown::exit - (JavaScript, client)
if(this.selectedIndex == "0"){
Textfield.access = "???????"
Textfield.fillColor = "255,255,255"
}
else{
Textfield.rawValue = this.rawValue;
Textfield.access = "readOnly"
Textfield.fillColor = "192,192,192"
}
我可以将文本字段更改为只读,但无法将其改回可写。有人可以建议我怎么做吗?除了 "readOnly",我还可以为文本字段分配哪些其他访问控制。
谢谢!
Report.Page2.part2.body.subform.Dropdown::exit - (JavaScript, client)
if(this.selectedIndex == "0"){
Textfield.access = ""
Textfield.fillColor = "255,255,255"
}
else{
Textfield.rawValue = this.rawValue;
Textfield.access = "readOnly"
Textfield.fillColor = "192,192,192"
}
已经有一个被接受的答案,因此只需添加一些详细信息,说明它为何按照我评论中建议的方式工作。
TextField.access="literal";
将生成如下标记
<input type="xxx" literal>
</input>
框架中有一些验证来检查允许的值,因此文字不会破坏此处的 HTML。关键问题是这个文字不是属性,所以它不能有值。例如,以下标记是不可能的:
<input enabled="false"></input>
为了清除该属性,您可以重置它的唯一方法是使用如下空字符串:
TextField.access="";
我正在使用 Adobe AEM Form,javascript 编写脚本。
在我的表单中,我有一个下拉菜单,允许用户选择一个下拉值项目或通过键入来填充文本字段。我的脚本如下:
Report.Page2.part2.body.subform.Dropdown::exit - (JavaScript, client)
if(this.selectedIndex == "0"){
Textfield.access = "???????"
Textfield.fillColor = "255,255,255"
}
else{
Textfield.rawValue = this.rawValue;
Textfield.access = "readOnly"
Textfield.fillColor = "192,192,192"
}
我可以将文本字段更改为只读,但无法将其改回可写。有人可以建议我怎么做吗?除了 "readOnly",我还可以为文本字段分配哪些其他访问控制。
谢谢!
Report.Page2.part2.body.subform.Dropdown::exit - (JavaScript, client)
if(this.selectedIndex == "0"){
Textfield.access = ""
Textfield.fillColor = "255,255,255"
}
else{
Textfield.rawValue = this.rawValue;
Textfield.access = "readOnly"
Textfield.fillColor = "192,192,192"
}
已经有一个被接受的答案,因此只需添加一些详细信息,说明它为何按照我评论中建议的方式工作。
TextField.access="literal";
将生成如下标记
<input type="xxx" literal>
</input>
框架中有一些验证来检查允许的值,因此文字不会破坏此处的 HTML。关键问题是这个文字不是属性,所以它不能有值。例如,以下标记是不可能的:
<input enabled="false"></input>
为了清除该属性,您可以重置它的唯一方法是使用如下空字符串:
TextField.access="";