Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

problem with hidden/invisible table

Avatar

Level 2
hi



i am trying to make invisible or hide a whole table in a dynamic form using a checkbox, i have this formcalc in the change event.



if (this.rawValue == 1)

then

Table1.presence = "visible";

else

Table1.presence = "hidden"

endif



Any ideas?
5 Replies

Avatar

Former Community Member
Check the java console and see if you are getting any errors. Is the form saved as dynamic?

Avatar

Former Community Member
i dont think you need "then" or "endif"



your code should look something like this:



if (this.rawValue == 1)

Table1.presence = "visible";

else

Table1.presence = "hidden"

Avatar

Level 2
hi



thanks for reply



the pdf render format is dynamic at the moment it is a .xdp file.



there are no errors in the java box (ctrl J)



i do get a syntax error near token "'hidden'" on line 7



----

it is not essential that the visibility of the table be controlled by a check box. in fact it would be better if the table would autohide itself if no addInstance(1) were selected. but i dont know how to do that either

Avatar

Former Community Member
So you do have javascript errors. The code should look like this:



if (this.rawValue == 1){

Table1.presence = "visible";

}else {

Table1.presence = "hidden"

}



Lets make it work with the checkbox 1st, then we can write a test for the addInstance (as you say).

Avatar

Level 2
thanks paul code worked a treat thanks again for help