生命周期根据用户输入隐藏/显示部分

时间:2013-10-30 21:32:56

标签: javascript forms adobe livecycle-designer

我正在尝试创建一个生命周期表单,您可以根据用户输入隐藏/显示部分。

我正在使用单选按钮根据所选的单选按钮指示哪个部分应该可见。整个表格中会有很多,我要求表格流动,没有空格。你能告诉我如何创造条件吗?

我有很多部分,我知道该部分的内容需要设置为流,但我是在主表单还是每个部分执行此操作?根据我选择使内容流动的子窗体,它可以更改我不想要的部分对象的布局,因此我可能需要建议如何纠正它。 除了创建简单的表单之外,我没有任何使用Livecycle的经验。我试图在整个网络上找到这方面的帮助,但没有任何东西向我显示我需要的东西。任何帮助将不胜感激。

我试图在我的一个单选按钮上使用此代码。它在更改事件中的设置如下:

if (this.rawValue == "1")
{    
    xfa.resolveNode("Section2.Section2.1").presence="visible";      
    xfa.resolveNode("Section3").presence= "hidden";    
    xfa.resolveNode("Section2.Section2.2").presence = "hidden"    
}
else (this.rawValue == "0")
{    
    xfa.resolveNode("Section2.Section2.1").presence = "hidden";    
    xfa.resolveNode("Section3").presence= "hidden";    
    xfa.resolveNode("Section2.Section2.2").presence = "hidden";

}

1 个答案:

答案 0 :(得分:1)

是的,您需要使根子表单(页面)布局不可定位。 这将根据显示/隐藏行为自动重新定位包含的子表单。

你的代码应该说:

if (this.rawValue == 1)
{    
    xfa.resolveNode("Section2.Section2.1").presence="visible";      
    xfa.resolveNode("Section3").presence= "hidden";    
    xfa.resolveNode("Section2.Section2.2").presence = "hidden"    

else if (this.rawValue == 2)
{    
    xfa.resolveNode("Section2.Section2.1").presence = "hidden";    
    xfa.resolveNode("Section3").presence= "hidden";    
    xfa.resolveNode("Section2.Section2.2").presence = "hidden";

}

我倾向于使用click事件而不是使用单选按钮这样的更改事件。

欢呼声