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
185
How can we get HTML Editor's plain text at client side
posted

We are using  Infragistics WebHtmlEditor control.

We need to have maximum length validation at the client side. For this we need to get the control's plain text (at client side)

How can we get this?

Thanks in advance

Parents
  • 3147
    posted

    Hi Ranganatha, try this code:

    function getWebHtmlEditorText() 
    {
       var editor = iged_getById('<%= WebHtmlEditor1.ClientID %>');
       if (!editor) return ""; 
       if (editor._ie) return editor._elem.innerText;
       if (editor._body().innerText) return editor._body().innerText;
       return editor._body().textContent;
    }

    Put the correct editor ID in place of WebHtmlEditor1 and you are ready to go.

Reply Children
No Data