Expand my Community achievements bar.

Hide Subform Using Check Box

Avatar

Level 2
I would like to use a check box to make a subform visible when checked. I am using the following do try and do this, but it's not working:



if(this.rawValue=="Yes")

{form1.SF1.presence="visible";}

else

{form1.SF2.presence="hidden";}



I have SF2 set to "Hidden", but have tried to change it to "invisible" but I still can't get this to work. Any help would be greatly appreciated.



Thanks.
2 Replies

Avatar

Level 5
There are few things that you need to check...

1. Check you saved the template as Dynamic. (Code may not work if you saved or rendered as Static).

2. If you are in preview mode set the default Preview mode to Dynamic mode in File>>Form Properties>>Default Tab\\Preview mode.

3. Use the code on 'change' or 'exit' events of the checkbox.

4. Modify your code to read as follows...

if(this.rawValue==1){

form1.SF1.presence="visible";

}else {

form1.SF2.presence="hidden";

}



Good Luck,

SekharN

Avatar

Level 2
It worked great. Thanks for your help.