繁体   English   中英

LiveCycle下拉列表引用If语句中的另一个字段

[英]LiveCycle drop-down list reference another field in an If statement

我有2个下拉列表,它们都提供“ 其他”的选择。 其他的选择,一个文本字段(“其他”)变得可见。 如果选择了其他选项,则该字段将被隐藏。 但是,如果列表“ Cut”显示其他 (反之亦然),则当列表“ Tool”的其他选项被选择时,我不想隐藏该字段。 显然我在这里缺少了一些东西:

form1.RFQ.Body.RequiredItems.Table1.Row1.Col2.Types.Tool::change - (JavaScript, client)

if(xfa.event.newText == "Other"){
    Other.presence = "visible";
}

else{
    if (Cut.caption == "Other"){
        Other.presence = "visible";
    }
    else{
        Other.presence = "hidden";
    }
}

如果仅当两个选项都是其他选项时才希望显示“其他”文本字段,则在两个下拉列表的退出事件中都需要类似这样的内容。

if(Tool.rawValue == "Other" && Cut.rawValue == "Other") Other.presence = visible;
else Other.presence = "hidden";

只要在对象面板中选择了“提交时:选择”,使用退出事件就和“更改”事件一样有效。 这是默认选项。

如果您只希望下拉列表中的EITHER显示为“ Other”,那么您需要以下代码:

if(Tool.rawValue == "Other" || Cut.rawValue == "Other") Other.presence = visible;
else Other.presence = "hidden";

我无法使您的答案发挥作用,这非常困难,但是我不了解脚本的很多知识。 但是,这对我有用(在“绑定”选项卡上选中“指定项目值”,列表选项“其他”的值为4):

var othercut = Cut.rawValue

if(xfa.event.newText == "Other"){
    Other.presence = "visible";
}
else{
    if (othercut == 4){
        Other.presence =  "visible";
    }
    else{
        Other.presence = "hidden";
    }
}

这将用于“工具”下拉列表; 在“剪切”下拉菜单中进行了相应的更改。

我以前尝试过使用逻辑运算符,但是一无所获。 不过,我确实很喜欢在两种情况下均有效的公式。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM