Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

calling functions

Avatar

Not applicable

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 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.

Avatar

Not applicable

Now I understand it!

Thanks a lot guys!

Eloi