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...?)

Link to comment
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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.