如何根据单选按钮上的选择预填充 Orbeon 文本字段

How to pre-fill the Orbeon text field based on selection on radio button

我正在创建一个 Orbeon 表单。有一个单选按钮 (control-114) 字段和一个文本字段 (control-111)。

我在计算值中尝试了以下语法:

 if($control-114='1') then $control-111='1' else '' 

你那个表情就快到了!在 "Control Settings"、"Formulas"、"Calculated Value" 中 control-111(文本字段),您需要:

if($control-114 = '2') then 'xxx-xxx-xx' else .

此外,在 "Read-Only" 中,您应该将字段明确标记为 而不是 read-only,使用以下内容,否则字段带有 "Calculated Value"自动变成read-only.

false()