Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 844469
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:17:26+00:00 2026-05-15T06:17:26+00:00

I’ve tried to implement a cursor focus on an input area and IE has

  • 0

I’ve tried to implement a cursor focus on an input area and IE has given my a lot of headaches. I’ve tried things along the line of (changing the timeout too, to large numbers):

setTimeout(function() { document.getElementById('myInput').focus(); }, 10);

and it won’t work. I’ve noticed that I have an applet on the page as well, and when I remove the applet, the above works. Also if I put an alert before the focus() trigger, it will work.

The applet doesn’t do anything in particular (it actually retrieves the user’s MAC address) and it makes one call to an external JS function at the end to send the MAC address to the DOM. I’ve tried putting the focus (timeout and all) at the end of that JS function but that won’t work either.

What could be wrong? Things work well in Firefox, just not in IE.

Current setup:

//This is called from within the applet using a window.call
function everythingDone()
{
$("#someinput").focus();
//setTimeout(function() { document.getElementById('someInput').focus(); }, 1000);
};

$(function() 
{
    var applet = "<object classid='clsid:CAFEEFAC-0014-0002-0000-ABCDEFFEDCBA' width='0' height='0'><param name='code' value='someapplet.class' /><param name='archive' value='/someapplet.jar' /></object>";
    $("#appletarea").html(applet);
    //setTimeout(function() { document.getElementById('someInput').focus(); }, 1000);
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T06:17:26+00:00Added an answer on May 15, 2026 at 6:17 am

    This is an infamous bug in Sun Java plugin for IE. You can find a full discussion at
    https://bugs.java.com/bugdatabase/view_bug?bug_id=4984794.
    Unfortunatly the bug is closed as not reproducible! Among the workarounds proposed, the following worked great for me:

    Crookster

    If anyone is interested, I believe I
    found a workaround for this.

    In your applet start() method, add the
    following:

    JPanel panel = new JPanel();
    this.add(panel);
    panel.addFocusListener(new
    FocusAdapter() { public void
    focusGained(FocusEvent e) { JSObject
    win = (JSObject)
    JSObject.getWindow(this);
    win.eval("onAppletLoad();"); } });
    panel.requestFocusInWindow();

    Then, within your HTML code, add the
    following function:

    function onAppletLoad() {
    myField.focus(); //where myField is
    the field to get focus!! }

    You’ll have to import the following in
    the applet

    import netscape.javascript.*; //
    JSObject class, used to get the HTML
    page

    and add plugin.jar to your classpath.
    You’ll find plugin.jar within your JRE
    /jre/lib directory (1.4.x+)

    Although the applet has a JPanel, just
    set the size to 0,0 and you won’t see
    it.

    Hope this helps

    Shawn

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.