Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Javascript : Detect the source of an event

Community Expert ,
Oct 21, 2019 Oct 21, 2019

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


Acrobate du PDF, InDesigner et Photoshopographe
TOPICS
Acrobat SDK and JavaScript
717
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Oct 22, 2019 Oct 22, 2019

Check event.name and event.type.

Translate
LEGEND ,
Oct 21, 2019 Oct 21, 2019

Have the event pass this info in a parameter.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2019 Oct 22, 2019

Check event.name and event.type.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2019 Oct 22, 2019

Thank you, I will check that.


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2019 Oct 22, 2019

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
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2019 Oct 22, 2019
LATEST

"Check event.name"

 

Got it!

Thank you


Acrobate du PDF, InDesigner et Photoshopographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines