Support forums
in

Add a Event to Textarea in CE

Last post 02-04-2006, 12:28 AM by Anonymous. 7 replies.
Sort Posts: Previous Next
  •  02-01-2006, 6:59 AM 15422

    Add a Event to Textarea in CE

    How Can Add a Event (For Example OnKeypress ) to Textarea in CE

  •  02-01-2006, 7:30 AM 15423 in reply to 15422

    Re: Add a Event to Textarea in CE

    Demo is here:
     
     
    Hope it helps.
     
    Let me know if you have any further questions.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-01-2006, 9:08 AM 15429 in reply to 15423

    Re: Add a Event to Textarea in CE

    Thanks. Very Good
  •  02-01-2006, 9:37 AM 15432 in reply to 15423

    Re: Add a Event to Textarea in CE

    i can not add a event to textarea in CE with out button. i can add a event to textarea in CE Automatically when load it.

  •  02-01-2006, 10:16 AM 15434 in reply to 15423

    Re: Add a Event to Textarea in CE

     

    Actual I can put a function in onkeypress event of textarea in CE that it return keyCode  For me.

     

  •  02-01-2006, 3:52 PM 15449 in reply to 15434

    Re: Add a Event to Textarea in CE

    Please check the source code of the above example.
     
    function CE_attachEvent()
       {
        // get the cute editor instance
        var editor1 = document.getElementById('CE_Editor1_ID');
        
        //Get the editor content 
        var editdoc=editor1.GetDocument();
        // attach Event
        if(editdoc.attachEvent)
         editdoc.attachEvent('onkeypress',HandleChange);
        else if(editdoc.addEventListener)
         editdoc.addEventListener('keypress',HandleChange,true);
       }   
       
       function CE_detachEvent()
       {
        // get the cute editor instance
        var editor1 = document.getElementById('CE_Editor1_ID');
        
        //Get the editor content 
        var editdoc=editor1.GetDocument();
        // detach Event
        if(editdoc.detachEvent)
         editdoc.detachEvent('onkeypress',HandleChange);
        else if(editdoc.removeEventListener)
         editdoc.removeEventListener('keypress',HandleChange,true);
       }
       

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  02-02-2006, 1:30 AM 15473 in reply to 15449

    Re: Add a Event to Textarea in CE

    My Source Code :
     -----------------------------------------------------------------------------------------------------
    <%@ Page Language="C#"%>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
      <meta name="ProgId" content="SharePoint.WebPartPage.Document">
      <meta name="WebPartPageExpansion" content="full">
      <title>ASP and ASP.NET WYSIWYG Editor - Default Configuration </title>
      <link rel="stylesheet" href="../example.css" type="text/css" />
     </head>
     <body>
            <form runat="server">
       
       <table border="0" cellpadding="0" cellspacing="0">
        <tr>
         <td width=10 nowrap></td>
         <td valign="top" nowrap id="leftcolumn" width="160">
            
         </td>
         <td width="20" nowrap></td>
         <td valign="top" width="760">
          <b>Enable All Toolbars</b>
          <hr>
          This example show you <b>all the predefined buttons</b>.
          <br>
    <INPUT id="blang" class="btchzaban" onclick="chzaban()" type="button" value="FA" name="blang" title=" CTRL + L " ><br>
         
     <CE:Editor id="Editor1" EditorWysiwygModeCss="../example.css" runat="server" ></CE:Editor><br />
          </td>
        </table>   
      </form>
     <script language="JavaScript" type="text/javascript" >
           
            // JavaScript source code
    //-----------------------------

    function keyConv(e)
    {
     
     
     alert(e.keyCode)
     
    }
    //------------------------------
    function chzaban()
    {
     CE_attachEvent();
     
    }
      
    //------------------------------------------------------------------
    function CE_attachEvent()
       {
        // get the cute editor instance
        var editor1 = document.getElementById('CE_Editor1_ID');
       
        //Get the editor content 
        var editdoc=editor1.GetDocument();
        // attach Event
        if(editdoc.attachEvent)
       
      editdoc.attachEvent('onkeypress', keyConv(event));
       
        else if(editdoc.addEventListener)
         editdoc.addEventListener('keypress', keyConv(event),true);
       }  
      
    //-----------------------------------------------------------------

          
            </script>

     </body>
    </html>
    ------------------------------------------------------------------------------------
     
     I have a request : at first User Click On "FA Button", then  user must be click on  textarea and type anythings , now I want To Create an  Alert Box about KeyCode .
  •  02-04-2006, 12:28 AM 15588 in reply to 15473

    Re: Add a Event to Textarea in CE

    Please Help Me
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems