Skip to content

Instantly share code, notes, and snippets.

@wteuber
Created November 16, 2015 14:09
Show Gist options
  • Save wteuber/acfb8d118d097051b9ad to your computer and use it in GitHub Desktop.
Save wteuber/acfb8d118d097051b9ad to your computer and use it in GitHub Desktop.
ctrl_enter.js - send forms when pressing crtl+enter instead of only pressing enter
$(document).ready(function() {
$(window).keydown(function(event){
if((event.keyCode == 13 || event.keyCode == 10) && !event.ctrlKey) {
event.preventDefault();
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment