Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Make a ComboBox appear based upon the selection of another ComboBox

Avatar

Level 1

Helle everyone,  I am new to live cycle so please be basic.  I have just gone through and created a form in livecycle and i have two comboBoxes.  Lets just call them ComboBox1 and ComboBox 2 . ComboBox1 one is simply a yes or no.  If you answer yes I would like comboBox2 to appear and be required to fill in else basically the Form Stays the same.

I have gone through and wrote an if statement but I think Iam puting the script in the wrong place.  Right now I have it in the exit of ComboBox1.  If someone could please help me I would appreciate it.  Also, if someone has a good manual either on Livecycle or scripting please let me know. I know a little VB but thats it.

John

3 Replies

Avatar

Level 6

check the attached pdf.

script written on layout ready it will work.

----- form1.P1.ComboBox1::ready:layout - (JavaScript, both) ----------------------------------------

if(this.rawValue == 1){
combBox.presence = "visible";
}
else if(this.rawValue == 0){
combBox.presence = "hidden";
}

Avatar

Level 1

Thanks for the information,  Your example is exactly what i am looking for but when i type that code in i keep getting errors. Here is what i have typed in.

-----------------

------------------form1.#subform[1].ComboBox1::ready:form - (JavaScript, client)--------------------------

if

(this.rawValue ==1)

{ComboBox2.presence

= "visible";}

else

if(this.rawValue == 0)

{ComboBox2.presence

= "hidden";}

---------------------------------------------

I get an Error of Syntax Error near Token '{' on line 2, column 1

Any suggestions.

Avatar

Level 6

could you please upload ur pdf file?

did u place ur hidden/visible combobox alone on the page or inside any specific sub form?

if placed alone, place in a subform defined on the page that currently having and try.