Hi,
How can I get the type of a key event (keypress, keyup etc...).
In a normal Javascript code I use addEventListener or attachEvent,
but how does it work with the API.
Can someone gives me a piece of code ?
Thanks.
How can I get the type of a key event (keypress, keyup etc...).
In a normal Javascript code I use addEventListener or attachEvent,
but how does it work with the API.
Can someone gives me a piece of code ?
Thanks.
Re: Get a key event type ?
onkeydown:
onkeypress :
PS : editor1 = your editor's name.
Re: Get a key event type ?
Merci beaucoup !
Note: For the onkeypress event 'key' argument doesn't work but 'keypress' does.
Re: Get a key event type ?
And now I use key and it works fine.
Re: Get a key event type ?
What is your browser ?
Re: Get a key event type ?
Re: Get a key event type ?
Re: Get a key event type ?
I need help seriously. I don't know where to place and what code to capture the editing of the content of the editor upon onChange or onKeyUp/onKeyDown, etc. I need to update the hidden field (I have its ID or name listed as 'Source') that is associated with the iframe of the editor each time it is updated. Can someone help locate or create the following:
1 - The file where to add the function - name and where to find it
2 - Name of the editor or ID - to use in the javascript code
3 - the complete code to add to capture the changes that go on inside the editor - I want to change the hidden field Source found in the main page of the iframe of the editor
Thanks a lot
Awny
Re: Get a key event type ?
hi, just a doubt about this code. Where to put this code in the code in the CKEditor source code?
I tried putting it in several places but to no avail.
pls help!
Re: Get a key event type ?
This is a more proper one...
CKEDITOR.on('instanceCreated', function(e) {
e.editor.on('contentDom', function() {
e.editor.document.on('keyup', function(event) {
// keyup event in ckeditor
}
);
});
});
Re: Get a key event type ?
Code:
CKEDITOR.on('instanceCreated', function (e) {
e.editor.on('contentDom', function () {
var editor_copy = e.editor;
e.editor.document.on('keydown', function (event) {
// keyup event in ckeditor
var key = event.data.getKey();
var valueText = $('<div>' + editor_copy.getData() + '</div>').text();
if (key == "8") {
var prevchar = valueText.charAt(valueText.length - 1);
if (prevchar == "*") {
return false;
}
}
return true;
});
});
});
really can't disable at any key
CKeditor key up event
get data and events
Hi;
I'm searching for seven hours and didn't find the way that I can fetch this editor data in client side...
I tested all of samples, documentations,manulas test...
please some body help me, it's my first day in ckeditore...
I have a single editore in my page and want to fetch every single character that users type in editore and send it with Ajax to other page...
this is my head of page:
<script type="text/javascript" src="../jQuery/jquery-1.10.2.min.js"></script>
<script type="text/javascript" src="../ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="../ckeditor/adapters/jquery.js"></script>
and this is my html body:
<form>
<textarea class="ckeditor" id="editor1" name="editor1" rows="10" cols="80">
This is my textarea to be replaced with CKEditor.
</textarea>
</form>
and these are my tests:
<script type="text/javascript" language="javascript">
CKEDITOR.instances.editor1.on('contentDom', function() {
CKEDITOR.instances.editor1.document.on('key', function(event) {
alert('tss');
/*your instructions*/});
CKEDITOR.instances.embMessageText.on('key', function(event) { alert('HELLO'); });
});
</script>
I test these too:
I can't undrestand how this works and I'm very unsatisfied of documentation on this site because I read this several times, there is very middle nad advanse knowledge about but noting for newbies...
thanks for help...