Rad Editor addExternalHandler blur Safari Problem

2 posts, 1 answers
  1. Thiyagu
    Thiyagu avatar
    7 posts
    Member since:
    Nov 2011

    Posted 27 Mar 2013 Link to this post

    Hi Friends,

    I am having some trouble in radeditor addExternalHandler for safari browser. It seems that the following attached code works fine in IE, but it fails to do so in safari. Help would be much appreciated. Thanks.
    <script type="text/javascript">
        function CharactersLimit(editor) {          
     
            var element = document.all ? editor.get_document().body : editor.get_document();
            $telerik.addExternalHandler(element, "blur", function (e) {
                alert('blur');
            });
     
        }
    </script>
     
     
        <telerik:RadScriptManager runat="server">
        </telerik:RadScriptManager>
        <telerik:RadEditor ID="Editor1" runat="server" OnClientLoad="CharactersLimit">
        </telerik:RadEditor>


  2. Answer
    Rumen
    Admin
    Rumen avatar
    14075 posts

    Posted 28 Mar 2013 Link to this post

    Hi,

    For Safari and Chrome you should use editor.get_contentArea(); for an element to which to attach the handlers:

    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientLoad="OnClientLoad"></telerik:RadEditor>
    <script>
    function OnClientLoad(editor, args) {
      var element = editor.get_contentArea();
      $telerik.addExternalHandler(element, "blur", function (e) {
        var msgLbl = document.getElementById("lbMessageId");
        msgLbl.innerHTML = "blur";
      });
      $telerik.addExternalHandler(element, "focus", function (e) {
        var msgLbl = document.getElementById("lbMessageId");
        msgLbl.innerHTML = "focus";
      });
    }
    </script>
    <span id="lbMessageId"></span>




    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top