Results 1 to 3 of 3

Thread: Events

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Hi,
    can someone let me know what event ( if any ) is fired when a user types something in a text box WITHOUT exiting the control. I don't think the answer is onChange, this requires exiting the control

    "The onChange event handler executes JavaScript code when input focus exits the field after the user modifies its text. "

    http://www.eborcom.com/webmaker/tuto....html#onChange

    I want to flag a message if the cotents of a text box are changed without leaving the control, so if, for example a textbox contains the worg dog and I delete the g then the event would fire.

    Thanks in advance.

    Lenin.

  2. #2
    Guest
    You can try the onKeyDown event but I'm not sure how widely supported it is. It might only work in IE. Here's an example of how it can work:

    Code:
    <HTML>
    <HEAD>
    <TITLE>test.asp</TITLE>
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    function echoIt()
      {
      parText.innerHTML = txtTest.value;
      }
    -->
    </SCRIPT>
    </HEAD>
    <BODY>
    
    <INPUT NAME="txtTest" ID="txtTest" SIZE=20 onKeyDown="echoIt()">
    
    <P NAME="parText" ID="parText"></P>
    
    </BODY>
    </HTML>

    Paul

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Feb 1999
    Location
    Belfast
    Posts
    254
    Many thanks Paul. That did the trick.

    Lenin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width