I need to create an autosave type of functionality while the user is editing rich text. In the normal textbox – I can get the lazy events I need to do this, such as the KeyUp event (as TextChanged only fires when focus leaves the control).
However – for the TinyEditor and also the TinyMCE controls – I cannot get these events. I understand they are “lazy” events and you have to explicitly attach the events. But still they do not work.
I thought I would work around this challenge and check every few seconds manually (using a timer) and see if the text has changed, and then if so do my autosave logic.
But that doesn’t work either – even though the user has typed more text in the control – the .Text property does NOT reflect the user’s changes until you lose focus on the control. This also is a problem for both TinyEditor and TinyMCEControls.
Are there any work arounds? Is there a .Eval() way to get the text to update so that the .text property reflects whats in the control without having to lose focus?
Attached is a project showing this behavior.
Thanks very much in advance for your help.
Hi Luca – anyway to use javascript to get at the real text, or to have the text property updated to have the real content?
Thanks Luca.
In the meantime – is there any javascript i can call via .Eval() that would cause the TinyEditor.Text property to be updated?
HTML editor are created in an iframe and events from iframes don’t bubble up. You’d have to modify the extension and subscribe to the events made available by the editors. I’ll log an enhancement here:
https://github.com/iceteagroup/wisej-extensions
You can click Watch in github to receive automatic notifications when something changes and you can log issues, fork the code, etc:
Also, look at this blog entry in case it helps:
Please login first to submit.