Infragistics Home

Infragistics Forums

Infragistics community online discussions.
Welcome to Infragistics Forums Sign in | FAQ
in Search

WebHTMLEditor value not correct

Last post 08-14-2008 13:13 by [Infragistics] Vince McDonald. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 08-13-2008 13:09

    • yurye
    • Not Ranked
    • Joined on 08-13-2008
    • Points 20

    WebHTMLEditor value not correct

    Hi

     What i want to do is while typing in the editor i want same info to be typed in to a regular txt box.

     

    I have this code:

     function  WebHtmlEditor1_KeyPress(oEditor, keyCode, oEvent){
       
        document.getElementById('txtDebug').value = oEditor.getText();
    }

     

    it works ok, but the first letter typed does not display in the text box, then when you type the next letter the first letter will appear in the text box

     

    so it will look like this

    WebHTMLEditor : Hello

    Textbox:              Hell

     

    how can i make sure all the letters make it to the text box? 

       

     

    • Post Points: 20
  • 08-14-2008 13:13 In reply to

    Re: WebHTMLEditor value not correct

    The KeyPress event is happening as you press each key.  At that point, the text of the WebHtmlEditor is the text before the key press is processed, not after.

    In your example, when you press "H", the WebHtmlEditor's value is blank.  When you press "e", the editor's value is "H".  At the first "l', the editor's value is "He", and so on.

    You might be able to use window.setTimeout() to delay copying from the WebHtmlEditor to the text box for a few milliseconds - enough for the key press to complete being processed.  I don't have an example that I can put together at the moment, but I'm hopeful this will lead you in the right direction.

    Vince McDonald
    Manager of Developer Support, MCP
    Infragistics, Inc.

    Was this post helpful? Please let me know by using the star ratings and the "Answered" button from the forum's web interface.

    Need help? Find the various ways you can ask for help from Infragistics.
    • Post Points: 5
Page 1 of 1 (2 items)
Powered by Community Server (Commercial Edition), by Telligent Systems