Created
June 1, 2016 13:11
-
-
Save DominicFinn/62d961b3db454bea63d24070593f82fa to your computer and use it in GitHub Desktop.
Just removes enter presses whilst typing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.12.4.js" integrity="sha256-Qw82+bXyGq6MydymqBxNPYTaUXXq7c8v3CwiYwLLNXU=" crossorigin="anonymous"></script> | |
<script type="text/javascript"> | |
$('document').ready(function() { | |
$('#smstemplate').keyup(function(e){ | |
if (e.keyCode != 13) return false; | |
var $currentTarget = $(e.currentTarget); | |
var replaced = $currentTarget.val().replace(/\n/g, ""); | |
$currentTarget.val(replaced); | |
}) | |
}); | |
</script> | |
</head> | |
<body> | |
<textarea id="smstemplate"></textarea> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment