Expand my Community achievements bar.

Can you make an enter event in topmostsubform that gets the field name of any field thats entered

Avatar

Level 1

Looking for some help.

I have a modified Enter Event I'm trying to use. What my expected results are: When you click on a field on the PDF, it would open up a certain webpage or file depending on what field is entered. I currently have:

if (xfa.host.name == "Acrobat") {

          app.launchURL("www.cnn5.com" + "/" + event.target.documentFileName + "&" + this.name, true);

}

else {

          xfa.host.gotoURL("www.cnn5.com");

}

In this example, i'm using a bogus address obviously. "event.target.documentFileName" gives me the PDF name which is what I want, but I need to scrub off the ".pdf" at the end of it. I know I can use this in every field that I want it in, but I'm looking to see if I can get this code in just the topmostsubform only due to having hundreds of forms I might be using this form and to save time.

When this is used in the topmostsubform, it gives me the URL: "www.cnn5.com/PDFname.pdf&TopmostSubform" no matter what field i click into. Is there something i can change this.name to? Any help would be greatly appreciated.

Also, i'll need to have this event to be able to use multiple times, because currently in the topmostsubform, it only activates on the first field that I enter and doesn't activate on fields after that. Suggestions please? Thank you

1 Reply

Avatar

Level 10

Hi,

Are you using event propagation?  If you are try

 

xfa.event.target.name

Otherwise have a look at this  http://blogs.adobe.com/formfeed/2009/03/xfa_30_event_propagation.html

Regards

Bruce