Skip to content

Instantly share code, notes, and snippets.

@henrik
Created August 14, 2012 06:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik/3347047 to your computer and use it in GitHub Desktop.
Save henrik/3347047 to your computer and use it in GitHub Desktop.
Submit current form when pressing shift + alt/cmd + s.
// Submit current form when pressing shift + alt/cmd + s.
//
// By Henrik Nyh 2012-08-14 for Barsoom AB.
// Inspired by http://superuser.com/q/338255/59790
var S_KEY = 83;
$(document).keydown(function(e) {
if (e.shiftKey && (e.metaKey || e.altKey) && e.which == S_KEY) {
$(document.activeElement).closest("form").submit();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment