Resetting layers
Hi,
I'm trying to setup a button to turn off 9 layers on an interactive pdf form.
8 out of 9 of the layers turn off no problem but the 1 layer remains turned on. Really not sure why this is happening. Double checked obvious things like layer names but to no avail. The WR1 layer will not turn off when I click the reset button.
Could anyone please help me with this 'simple' task as I am not particularly advanced with Javascript.
PDF form attached here https://we.tl/t-gS6R4unxWl
Thanks in advance.
var layer = this.getOCGs();
for(var i=0; i<layer.length; i++)
{
if(event.target.value=="Yes")
{
if(layer.name=="WR1")
{layer.state=false};
}
{
if(layer.name=="CL1")
{layer.state=false};
}
{
if(layer.name=="NC1")
{layer.state=false};
}
{
if(layer.name=="WR2")
{layer.state=false};
}
{
if(layer.name=="CL2")
{layer.state=false};
}
{
if(layer.name=="NC2")
{layer.state=false};
}
{
if(layer.name=="WR3")
{layer.state=false};
}
{
if(layer.name=="CL3")
{layer.state=false};
}
{
if(layer.name=="NC3")
{layer.state=false};
}
}
Message was edited by: Ross Jackson
