Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Visible / Invisible code not working

Not applicable
This code used to wokr well under LiveCycle 8.0 but doesn't work with ES. Can you help me figure out why?



if (this.rawValue == "SNF" || "Custodial"){

DischargedToForm.presence = "visible";

}else{

DischargedToForm.presence = "invisible";

}

DichargedToForm is a subform containing a text box for additional information.
5 Replies
pguerett
Level 10
Level 10
Are you sure your form is saved as dynamic or you are previewing it as dynamic?
radzmar
Level 10
Level 10
Did you tried to mod your script a litle bit, like this?



if (this.rawValue=="SNF"),

if (this.rawValue=="Custodial");

_DischargedToForm.presence = "visible";

else

_DischargedToForm.presence = "hidden";



Don't forget to use JavaScript not FormCalc for scripting language 😉
Not applicable
Hi,

Your script doesn't work, Marcus.

Try this one instead:



if (this.rawValue=="SNF" || this.rawValue=="Custodial")

{

_DischargedToForm.presence = "visible"

}

else

{

_DischargedToForm.presence = "invisible"

}



As mentioned before, you must remember to select javascript, and save as dynamic form.
Not applicable
Thanks everyone for their input. I finally have it working and here is the code that works.



What this code does is when a change event is triggered in a drop down (this)that meets the either or condition it makes a subform (DischargedToForm)containing a text box visible for additional information input.



if (this.rawValue=="SNF" || "Custodial")

DischargedToForm.presence = "visible";

else

DischargedToForm.presence = "hidden";
Not applicable
Hi Parakash,

The syntax of OR clause in Javascript is as:



if (this.rawValue=="SNF" || this.rawValue=="Custodial")

DischargedToForm.presence = "visible";

else

DischargedToForm.presence = "hidden";



Your script work for all the values of the items to the if item, making it visible. Try your script first in your designer first. It does not work for me with Acrobat 8.1.2.

"_DischargeToForm" means "DischargeToForm.instanceManager".

"invisible" makes form invisible but have place on the form.

"hidden" makes form invisible and remove from layout also.

Asiye