Expand my Community achievements bar.

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

Making fields visible on click event

Avatar

Former Community Member
Hi Guys,



I have designed a form and I have to attach follow up questions depending on the answer to the previous question.



These follow up questions I have a presence of "invisble", but as mentioned, I need to make them visible depending on the answer to the previous question. Unfortunately in the PDF version my questions stay "invisible". I am using the scripting:

xfa.form.form1.#subform.ImageField1.presence = "visible"



Is this the correct format to make a field "visible"? If not please help me by giving me the correct script?



Thanks

Albert
1 Reply

Avatar

Former Community Member
Albert - An "if/else" statement might help you out. Try using the below example (place in the field that will initialize the hidden field to show). You'll might need to change the invisible/visible if I have it backwards. Hope this helps!



if (event.target.value =1) {

form1.#subform.ImageField1.presence = "invisible"

}

else {

form1.#subform.ImageField1.presence = "visible"

}