Blur Event

Last post 07-23-2011, 1:37 AM by JavedBoqo. 5 replies.
Sort Posts: Previous Next
  •  07-21-2011, 6:02 AM 68711

    Blur Event

    hi every body,
    how can i create blur event for editor in jquery. i have create blur event for editor using following code but do not succeed:
    Method 1 
    $('#CE_Editor1_ID_Frame').blur(function(){
           alert($('#CE_Editor1_ID').val());        
        });  
    Method 2
    $('#CE_Editor1_ID').blur(function(){
            alert($('#CE_Editor1_ID').val());
        });
    Method 3
    $('#Editor1').blur(function(){
            
        });
     
     
  •  07-21-2011, 11:08 AM 68729 in reply to 68711

    Re: Blur Event

    Hi JavedBoqo,
     
    please try the example below
     
    1. <?php include_once("cuteeditor_files/include_CuteEditor.php") ; ?>  
    2. <html>      
    3.     <head>  
    4.     </head>  
    5.     <body>  
    6.           
    7.         <form name="theForm" method="post" ID="Form1">  
    8.                   
    9.        <?php  
    10.             $editor=new CuteEditor();  
    11.             $editor->ID="Editor1";  
    12.             $editor->Text="Type here";  
    13.             $editor->Draw();  
    14.             $editor=null;  
    15.         ?>  
    16.         </form>  
    17.     </body>  
    18. </html>  
    19. <script>  
    20.   
    21. function CuteEditor_OnInitialized(editor)  
    22. {  
    23.     var editdoc = editor.GetDocument();  
    24.   
    25.     if(document.attachEvent)  
    26.     {  
    27.         //for ie  
    28.         editdoc.onfocusout=function()  
    29.         {  
    30.             alert("onblur");  
    31.         }  
    32.     }  
    33.     else  
    34.     {  
    35.           //for google chrome  
    36.         editdoc.body.addEventListener("blur",focusOut,false);  
    37.         //for firefox  
    38.         editdoc.addEventListener("blur",focusOut,false);  
    39.     }  
    40. }  
    41.   
    42. function focusOut()  
    43. {  
    44.     alert("onblur not ie");  
    45.  }  
    46. </script> 
    Regards,
     
    ken
  •  07-22-2011, 1:14 AM 68739 in reply to 68729

    Re: Blur Event

    thanks buddy my problem has been solved
  •  07-22-2011, 6:17 AM 68763 in reply to 68739

    Re: Blur Event

    hi kenneth once again.
     
     i need change event of editor so that i replace blur with change, but can't succeed:
    function CuteEditor_OnInitialized(editor)  {  
        var editdoc = editor.GetDocument();  
      
        if(document.attachEvent)  {  
            //for ie  
            editdoc.onfocusout=function()  {  
                alert("onblur");  
            }  
        }  
        else  {  
              //for google chrome  
            editdoc.body.addEventListener("change",focusOut,false);  
            //for firefox  
            editdoc.addEventListener("change",focusOut,false);  
        }  
    }  
     
  •  07-22-2011, 6:29 AM 68765 in reply to 68763

    Re: Blur Event

    Hi JavedBoqo,
     
    Please try the default API "OnChange"
     
    <script>  
    function CuteEditor_OnChange(editor)
    {
       alert("onchange");
    }
    </script>
     
    Regards,
     
    ken
  •  07-23-2011, 1:37 AM 68794 in reply to 68765

    Re: Blur Event

    thanks Kenneth once again.....
    Why the events of editor not mentioned in editor's documentation along with properties and methods?
View as RSS news feed in XML