Hello,
I have a WebHtmlEditor control on a page which i would like to make readonly client-side. I have done this using: iged_getById("txtEmailHTMLBody")._elem.contentEditable = false; and by also hiding the toolbar elements.
Whilst this appears to work and prevents key presses if i select existing text and press the tab key, the text is replaced by
Is there a better way to mark the control readonly using clientside script?
Thanks
Hi Warwick IC Systems Ltd,
Thank you for your reply. Glad that I was able to help.
Please do not hesitate to cotnact me if you have any further questions regarding this matter.
Hi,
That's exactly what i was after - thanks. I'd already tried something similar but couldn't manage to cancel the event from firing.
Cheers
Thank you for posting in the community.
In this scenario you may handle (and cancel as needed) the KeyDown clientside event of the editor. For instaince, to cancel the event on a tab click:
function WebHtmlEditor1_KeyDown(oEditor, keyCode, oEvent){ //cancel the event if the tab key has been pressed. if (keyCode == 9) { oEvent.cancel = true; }}
Additional checks can be implemented as need, for instance to ascertain whether the editor is readonly at that time.
Please let me know if this helps.