Disable Escape in Xpinc

Hey All

I found this little piece of code a while ago, that I use for every Xpinc app I am working on.

Just thought I would re share it because I find it invaluable.  Without it your users will have a tendency to just hit Escape which will close the app and could lose all their changes.

Special thanks to Tommy Valand for sharing it.


The only thing I add is an alert to tell my users to save.

Add code to Event=>OnClientLoad=>CSJS

dojo.addOnLoad( function(){
dojo.connect( document, ‘keydown’, function(e){
// 27 -> Key code for ESC -> stop event
if(e.keyCode === 27){
alert(“Escape has been disabled, Please save and then close the Tab”);




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s