These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Need help with layer visibility for my order form

grlintheworld
Registered: Dec 21 2009
Posts: 66

I've built a great new order form for my company, and I'm attempting to integrate some interactive color swatches. By using the "set layer visibility" action for each button, I've made it so that when you click on the blue swatch, the product turns blue, and when you click on the pink swatch, the product turns pink. Great, no problem. The trouble comes when I try to do the exact same thing for the 2nd product on that same order form.

Default for the whole page is blue. Let's say I make the first product pink. When I move over to the second product to make it pink as well, the first product goes back to the default blue. I can't seem to find a way to tell Acrobat that I want the form to remember the new layer state selected by the user and then go from there, rather than defaulting going back to the default each time the user tries to change the color on a new product.

I have a feeling that this can be solved using a JavaScript of some kind, but I'm really out of my depths now and hoping somebody can help.

Looking forward to hearing any suggestions!

Thanks...

My Product Information:
Acrobat Pro 9.2, Macintosh
revoxo
Registered: Jul 20 2009
Posts: 17
Acrobat "layers" are called Optional Content Groups (OCG) and can be accessed using Javascript via an array.
Go here: http://www.adobe.com/devnet/acrobat/?view=downloads
and download the Acrobat 9.1 SDK. Once installed, if you look in the JavaScriptSupport folder, there is a pdf which contains loads of useful examples of scripting including one which should be exactly what you need (OCGLayerControl). Just copy the appropriate scripts and adapt for your setup.
Hope this helps.