Expand my Community achievements bar.

Attention: Experience League Community will undergo scheduled maintenance on Tuesday, August 20th between 10-11 PM PDT. During this time, the Community and its content will not be accessible. We apologize for any inconvenience this may cause.

How to tell if the user open the form in IE Browser

Avatar

Former Community Member
I like to know if there is a function in the javascript which I can tell



the user open the form in IE browser or desktop acrobat reader.



Thanks for your help in advance.
3 Replies

Avatar

Level 5
Take a look at the External property of Doc.

I have not used it before, but it is listed in the API reference.



Detect whether this document is in a browser or not.

if ( this.external )

{

// Viewing from a browser

}

else

{

// Viewing in the Acrobat application.

}



Mark

Avatar

Former Community Member
hi Mark,



Try your suggestion for this.external,it always returns undefined whether opening the form in Acrobat reader or IE Browser.



also try event.target.external, i have same result returning undefined.



Ed

Avatar

Level 5
Ed:

The code I supplied earlier was out of the JS guide.

I also got the undefined result.

I tried the code below in a button on the form and had success:



if ( event.target.external )

{

// Viewing from a browser

app.alert("browser: " + event.target.external)

}

else

{

// Viewing in the Acrobat application.

app.alert("Acrobat: " + event.target.external)

}



In what place are you putting the code (control & event)?.

What versions of Acrobat & Browser are you using?



Mark