1

当一组两个选项按钮设置为是时,我正在尝试设置一个文本字段以显示文本。(它们是是和否单选按钮)。我设置了它们,所以当检查时,值为 1。

When Yes is selected, text is supposed to be visible in the text field. When No is selected, I would like for the field to be blank.

现在,当我运行测试数据库时,选中是,然后保存单选按钮看起来像是在保存是,但随后又恢复为选中否。

我正在用 Perl 编写我的钩子。到目前为止,我在 Yes 单选按钮的 Value Changed 挂钩中有这个:

my $checked = $entity->GetFieldValue($fieldname)->GetValue();
if($checked eq "1"){
        my $setCharge = " This text when check Yes!";
        $entity->SetFieldValue("name_of_text_field", $setCharge);
}

单选按钮都是 SHORT_STRING,我的字符串比较可能很明显。

我尝试将另一个单选按钮设置为 0 只是为了确保它未被选中,但这似乎是多余的,因为只能选择一个单选按钮。我试过为 no Value Changed 写一个钩子,但这也没有用。

想法?

4

0 回答 0