enter key for save textarea values ( CKEDITOR)
enter key for save textarea values ( CKEDITOR)
HTML
<script src="http://www.vagrantradio.com/demos/ckeditor/ckeditor/ckeditor.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>CKEditor</title>
<script src="http://cdnjs.cloudflare.com/ajax/libs/ckeditor/4.2/ckeditor.js"></script
</head>
<body>
<textarea id="editor1" name="editor1"></textarea>
</body>
</html>
JavaScript
$(document).ready(function () {
//set up the editor instance for ckeditor
var editor = CKEDITOR.replace('editor1', {
toolbar: [['Source'], ['Cut', 'Copy', 'PasteText'], ['Undo', 'Redo', '-', 'SelectAll', 'RemoveFormat'], ['Bold', 'Italic', '-', 'NumberedList', 'BulletedList', '-', 'Link', 'Unlink'], ['SpecialChar']]
});
$('body').on('keypress', function (e) {
if (e.target.id !== "editor1" && (e.keyCode ? e.keyCode : e.which) === 13) {
alert(e.target.id); // jquery ajax save function
}
});
});