-
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.
-
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
-
Many thanks Paul. That did the trick.
Lenin