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

Javascript LiveCycle下拉列表引用If语句中的另一个字段,javascript,if-statement,livecycle,Javascript,If Statement,Livecycle,我有两个下拉列表,两个都提供其他选项。选择“其他”时,文本字段“其他”将可见。如果选择了其他选项,则该字段将隐藏。但是我不希望在选择列表工具的不同选项时隐藏字段,如果列表剪切显示其他,或者反之亦然。很明显,我遗漏了一些东西: form1.RFQ.Body.RequiredItems.Table1.Row1.Col2.Types.Tool::change - (JavaScript, client) if(xfa.event.newText == "Other"){ Other.pres

我有两个下拉列表,两个都提供其他选项。选择“其他”时,文本字段“其他”将可见。如果选择了其他选项,则该字段将隐藏。但是我不希望在选择列表工具的不同选项时隐藏字段,如果列表剪切显示其他,或者反之亦然。很明显,我遗漏了一些东西:

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";
只要在对象选项板中选择了“提交打开:选择”,使用退出事件将与更改事件一样有效。这是默认选项

如果您只希望在下拉列表中的任何一个显示“其他”时它可见,则您需要以下代码:

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

Jasotatic,我没能让你的答案起作用,但关于脚本还有很多我不明白的地方。但是,我在Binding选项卡上检查Specify Item Values(指定项值),其中列表选项“Other”的值为4:

var othercut = Cut.rawValue

if(xfa.event.newText == "Other"){
    Other.presence = "visible";
}
else{
    if (othercut == 4){
        Other.presence =  "visible";
    }
    else{
        Other.presence = "hidden";
    }
}
这将用于工具下拉列表;在“剪切”下拉列表中进行相应的更改

我以前试过使用逻辑运算符,但一无所获。不过,我真的很喜欢这两种情况下都适用的公式