Skip to main content
JR Boulay
Community Expert
Community Expert
Oct 21, 2019 11:16 PM UTC
Answered

Javascript : Detect the source of an event

Hi

 

I would like my function to detect the source of the event (onFocus vs onBlur) as in the sample script below.
Is it possible ?

I just spent more than an hour in the Acrobat JS documentation, I did not find anything and I have itchy eyes ...

 

myFunction() {
if (event is onFocus) {// blablabla;}
else if (event is onBlur) {// blebleble;}
}

 

Thank you

This topic is closed to new replies. Start a new post to keep the conversation going.
Bernd Alheit
Bernd AlheitCorrect answer
Community Expert
Oct 22, 2019 8:30 AM UTC

Check event.name and event.type.

5 replies

JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
Oct 22, 2019 12:43 PM UTC

"Check event.name"

 

Got it!

Thank you

Translate
Acrobate du PDF, InDesigner et Photoshopographe
try67
Community Expert
Community Expert
Oct 22, 2019 12:16 PM UTC

Try event.source.name ... Keep in mind that event.source is sometimes null (for example, when resetting the form), so check for that first.

Translate
JR Boulay
Community Expert
JR BoulayCommunity ExpertAuthor
Community Expert
Oct 22, 2019 9:58 AM UTC

Thank you, I will check that.

Translate
Acrobate du PDF, InDesigner et Photoshopographe
Bernd Alheit
Community Expert
Bernd AlheitCommunity ExpertCorrect answer
Community Expert
Oct 22, 2019 8:30 AM UTC

Check event.name and event.type.

Translate
Legend
Oct 22, 2019 1:05 AM UTC

Have the event pass this info in a parameter.

Translate