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

SOLVED

did a tab key initiate exit event?

Avatar

Level 4

Hi,

I have a table on my form. If the user hits the tab key on the last field of the last row I want to add another row (as this happens in MS-Word tables for example).

My problem is: How do I find out what inititated an exit event on my field? Was it a tab key or did the user click with the mouse someplace else?

I would like to write something like

     if (xfa.event.trigger = "TABKEY") { ... }

Hope someone had had the same problem already.

Uli

1 Accepted Solution

Avatar

Correct answer by
Level 10

xfa.event.commitKey will return a value based on what was used to exit the field. A 3 means a tab was used a 1 means the mouse was used.

So you coudl write code that looks like this:

var keypressed = xfa.event.commitKey;
if (keypressed == 3){
app.alert("You exited this field by using a Tab")
}
if (keypressed == 1){
app.alert("You exited the field by using the mouse")
}

Paul

View solution in original post

0 Replies

Avatar

Correct answer by
Level 10

xfa.event.commitKey will return a value based on what was used to exit the field. A 3 means a tab was used a 1 means the mouse was used.

So you coudl write code that looks like this:

var keypressed = xfa.event.commitKey;
if (keypressed == 3){
app.alert("You exited this field by using a Tab")
}
if (keypressed == 1){
app.alert("You exited the field by using the mouse")
}

Paul

Avatar

Level 4

Excellent. I tried it and it works! Thanks a lot!

Once you know the key word you find the right documentation. In case someone else has the same problems: Here is more information:

http://livedocs.adobe.com/livecycle/8.2/acrobat_designer/wwhelp/wwhimpl/common/html/wwhelp.htm?conte...

which is the same as

http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf