Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

calling functions

Avatar

Former Community Member

Hello all,

I need to know about using functions in Adobe Forms.

How do I call them? Because it only works for me when I use them in the same event they are created.

Something like that:

 

function test1()

{

     xfa.host.messageBox("hello!");

}

test1();

It works fine because the declaration and calling of the function are in the same event.

How can I call functions that are elsewhere?

Thanks a lot,

Eloi

3 Replies

Avatar

Level 6

Look up "script object" in Designer's help doc.

Avatar

Level 10

Hi,

in Designer you can add script objects in the hierarchy.

Those script objects can hold the functions you hen can call from any event.

For example:

1. You create a new script object named "tests"

2. Then your function "test1" to this script object

3. To call it you then can use the script

tests.test1();

from a buttons click event.