Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
Tab key clears characters when should be readonly
posted

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

Parents
No Data
Reply
  • 49378
    Verified Answer
    posted

    Hi Warwick IC Systems Ltd,

    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. 

Children