Re: keypress event..

  •  05-31-2007, 11:52 AM

    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
     
View Complete Thread