Sign in to follow this  
AdrianMarshall

Closing popups from the keyboard

Recommended Posts

In order to make it easy for the operators, I would like to use a single keypress (eg Return) to close a 'helpful' popup window (rather than having to reposition the mouse and click).

I thought that I could use OnChar to trap the Return-key event, but despite getting Return-initiated code running as expected on a 'normal page', it doesn't appear to work on my PopupModal page

(I note that the value of strCurrentPage remains with the host page rather than changing to the popup which is called from it, and so have tried tracking the status of the opened popup with my own variable which is then used to select actions the closing action appropriate to the popup, but more fundamentally it would appear that the OnChar routine never runs whilst my pop up is open...?)

Share this post


Link to post
Share on other sites

OnChar and the other page events only apply to the main page, not popups. Probably the only way you could do this is to have the edit box in your popup change a channel and have the edit box submit on return press, then in the Event for the channel, call the closePopup() function to close the popup.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this