These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Popup window that only pops 1 time from a dropdown list selection

drizagon
Registered: Oct 22 2009
Posts: 41
Answered

Hello,

I have a popup window that is included in the mouse exit event, but it pops continually if you move the mouse around the area of the dropdown. How can I make it so the popup only shows 1 time and then is disabled?

Here is the code I have so far:

if (this.rawValue == "Jury Duty"){
app.alert("Please submit your jury duty summons to your Team Lead for verification.",1,0,"Jury Duty Notification Alert");
}

Thanks in advance for any insight!

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are a number of fancy things you can do with popup messages. For example, instead of an Alert box you could use a hidden text field, a timer, a some state machine logic to show the message for a short period of time.

But with your existing code the easiest solution is to use a field level variable.
if ((this.rawValue == "Jury Duty") &&  !this.bAlready){this.bAlready = true;app.alert("Please submit your jury duty summons to your Team Lead for verification.",1,0,"Jury Duty Notification Alert");}

You should also consider using a different event. The validate event for example, so the code is only called with the field value actually changes.

Since "this" is the current field object, "bAlready" is a member of the field object. At first it doesn't exist, which is interpreted as a "false" value. Then the code sets it to "true", blocking further use of the popup.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

drizagon
Registered: Oct 22 2009
Posts: 41
Works great! Thanks for the help. I did end up moving the code to the exit event as well.

Thanks again!