keypress event..

Last post 06-08-2007, 1:43 PM by nadiralishah. 5 replies.
Sort Posts: Previous Next
  •  05-21-2007, 10:39 AM 29836

    keypress event..

    Hello cutesoft support team..
     
    i need a solution of a problem...
     
    please let me know how can i use the keypress event with custsoft ASP editor.. like in this editor whenever i do keypress then i need to do some testing, like i need to show on the page number of characters user typed...
     
    hope you are getting my point...
     
    for example;
     
    i need to print this just above to the editor i am using on the page;
     
    Character Limit: 1205    Remaining: ????
     
    ???? will be replace with number of characters user is typed in the editor, i need to check this on each keypress..
     
    please help.. and let me not the resolution of this problem...
     
    Thanks in advance for the help..
     
    regards,
     
    Nadir Ali Shah
  •  05-22-2007, 4:27 AM 29877 in reply to 29836

    Re: keypress event..

    Nadir,
     
    Please check this example:
     
     
    You can find the source code of this example in the download package.
     
     

    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

  •  05-22-2007, 12:31 PM 29905 in reply to 29877

    Re: keypress event..

    Thanks for the response..
     
    but Adam, i just review the source of that demo and i got this one code;
    editor1.GetDocument();
     
    This GetDoument function returns editor's html, but i need editor's Text, for example: whatever user is writing only that contents, not the html... like i am writing you this message, i only need to get this content not with the html code...
     
    another very important thing  is that, i played with the provided demo.. but its not working when i press a key with ctrl or shift key.. i really need the resolution of this problem urgently.. please suggest something in this regard...
     
    waiting for your quick response..
     
    regards,
     
    nadir..
  •  05-22-2007, 9:25 PM 29941 in reply to 29905

    Re: keypress event..

    >>This GetDoument function returns editor's html, but i need editor's Text, for example: whatever user is writing only that contents, not the html... like i am writing you this message, i only need to get this content not with the html code...
     
    Please use the following code to get HTML code first.

        // get the cute editor instance
        var editor1 = document.getElementById('<%=editor.ClientID%>');
        
        // Get the editor HTML
        document.getElementById("myTextArea").value = editor1.getHTML();
     
    Then extract the Plain Text from the above HTML code.
     
    >>another very important thing  is that, i played with the provided demo.. but its not working when i press a key with ctrl or shift key.. i really need the resolution of this problem urgently.. please suggest something in this regard...
     
    Click the Attach Event button then do key press to test this example.
     
     
     
     
     
     
     

    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

  •  05-31-2007, 11:52 AM 30276 in reply to 29941

    Re: keypress event..

    Please read my comments in black bold below and reply as soon as you can...
     
    Please use the following code to get HTML code first.

        // get the cute editor instance
        var editor1 = document.getElementById('<%=editor.ClientID%>');
        
        // Get the editor HTML
        document.getElementById("myTextArea").value = editor1.getHTML();
     
    Then extract the Plain Text from the above HTML code.
     
    This means, your javascript API dont have any function that should return only the plain text, like here i am writing a plain text, i may need only this text, not the html like its bold, but i need only plain text... and please note one more thing, i may write here html as well for example; <b> hello world </b> any several other html codes as well, but if i have to write my own scripts to extract plain text from the html code of the editor then this will be a problem, because whatever html i will write here will gone as well... I believe, your javascript API should have a function that returns all the text but not html... for example editor1.getText() instead of getHTML.. however getHTML is also cool but it depends on usage... i really need just plain text..
     
    Please listen, what my problem is;
    i need to create a text counter outside this editor.. like i type abc, the counter value must be 3, so on each keypress, after i enter a character that counter function will count the number of characters in this window.. for example, i set the maxtext limt to 1000 of this editor... then i need a counter that will start from 0.. and will increment on each keypress, so that user will know, how much more characters they can enter... hope you are understanding what i mean..
     
    as i have used your ASP function of maximum text limit.. you have two type of functions, maximum text limit and another is for maximum html limit.. the same way, i believe you can easily create a javascript function to just get the contents instead of complete editor's html.. hope you are getting my point...
     
    >>another very important thing  is that, i played with the provided demo.. but its not working when i press a key with ctrl or shift key.. i really need the resolution of this problem urgently.. please suggest something in this regard...
     
    Click the Attach Event button then do key press to test this example.
     
    yes, i did the same way... i did key press, it works well while pressing just a key.. but if i need to press a key with shift key or ctrl key like shift + A or any other character then this keypress event not works...
     
    please do reply as soon as you can...
     
    its very urgent...
     
    waiting for your great response..
     
    regards,
     
    Nadir Ali Shah
     
  •  06-08-2007, 1:43 PM 30525 in reply to 30276

    Re: keypress event..

    no answer?
View as RSS news feed in XML