Get Editor Value from JavaScript

4 posts, 0 answers
  1. MarcoFischboeck
    MarcoFischboeck avatar
    6 posts
    Member since:
    Jul 2007

    Posted 17 Aug 2007 Link to this post

    Hello,

    i use the RadEditor Lite in a WCM Scenario.

    I want to get the value from the current Editor (the HTML Code / Text wich was typed in).

    The Field in the PageLoyout is labeled with: "Content" 
    <radE:RadHTMLField runat="server" id="Content" FieldName="Content">

    Can you help me?
  2. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 17 Aug 2007 Link to this post

    Hi,

    You can get a reference to all editors on the page with the following piece of JavaScript code:

    <script type="text/javascript">     
    function test()     
    {     
        if (typeof(RadEditorGlobalArray)!="undefined")     
        {     
            for(i=0;i<RadEditorGlobalArray.length;i++)     
            {     
                var editor = RadEditorGlobalArray[i];     
                var html = editor.GetHtml(true);  
                alert(html);   
            }     
        }     
    }     
    </script>   

    I hope this helps.

    Sincerely yours,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center

  3. MarcoFischboeck
    MarcoFischboeck avatar
    6 posts
    Member since:
    Jul 2007

    Posted 17 Aug 2007 Link to this post

    Oh, great, it works! Thank you very much!


    In the near feature i have to

    • add a button to the menu 
    • get the current selected Text.
    • insert a special html tag arround the selected Text

    Is there a kind of Client-Side SDK available? Maybe this can give me the answers?

    Greeting from Germany Marco

     
  4. Lini
    Admin
    Lini avatar
    2144 posts

    Posted 20 Aug 2007 Link to this post

    Hi Marco,

    A good place to start is the RadEditor for ASP.NET documentation - http://www.telerik.com/help/aspnet/editor/

    You can find out about the Client API and much more (customizing the toolbar, creating a dialog window, etc.) in the above help link.

    Kind regards,
    Lini
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top