FIX: KeyStrokes in a Dialog Box Are Preprocessed by IE

ID: Q191931

The information in this article applies to:

SYMPTOMS

If an applet launches a dialog box with a Textfield, and you enter some characters in it and delete them using the BACKSPACE key, you will notice that it causes the underlying Internet Explorer 4.0 page to go back one page or shutdown.

CAUSE

Internet Explorer 4.0 captures the keystroke and interprets them as GO BACK; that is, pressing the BACK button in the page.

RESOLUTION

To fix the problem, use Microsoft Internet Explorer 4.01, which you can download from http://www.microsoft.com/ie/.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem has been fixed in the Microsoft Internet Explorer 4.01.

MORE INFORMATION

Steps to Reproduce Behavior

1. Create a new Java Applet (TestKey.java) as follows:

      import java.applet.*;
      import java.awt.*;

      public class TestKey extends Applet
      {
         public void start()
         {
            Component c = this;
            while(!(c instanceof Frame))
               c = c.getParent();
            Dialog d = new Dialog((Frame)c, "hi", false);
            d.setBounds(200,200,200,200);
            d.setLayout(null);

            TextField t = new TextField();
            t.setBounds(50,50,100,30);
            d.add(t);
            d.show();
         }
      }

2. Create an HTML file (TestKey.html) for the above applet:

      <HTML>
      <TITLE>IE 4.0 BackSpace Problem</TITLE>
      <BODY>
      <H1>Type characters with focus in the Dialog's Text field
          and delete them using BackSpace Key</H1>
      <hr>
      <applet code="TestKey.class" width=400 height=475>
      </applet>
      <hr>
      </BODY>
      </HTML>

3. Compile the above Applet:

      JVC TestKey.java

4. Load the Web page (TestKey.html).

 In Internet Explorer 4.0 you will notice that while trying to delete
characters in the TextField, Internet Explorer either scrolls back one page, just as if you had pressed the Back button or it shuts down.

   The problem doesn't occur in Internet Explorer 4.01.

Additional query words: keystroke backspace delete
Version           : WINDOWS:4.0,4.01
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix

Last Reviewed: September 1, 1998