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 8051921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:24:58+00:00 2026-06-05T07:24:58+00:00

I have to implement a simple onscreen keyboard, where the user has to first

  • 0

I have to implement a simple onscreen keyboard, where the user has to first click on one of 10 input boxes (to give it focus), then use the onscreen keyboard to add letters to the focused input.

The problem that I am having is that in IE (7, 8 and 9), the letters are being added to the 5th input box every time, regardless of which input box is trying to take focus.

Can anyone please clarify why this is happening?

Below I provide code, which works perfectly in Chrome and Firefox.

<img onClick='addIt("q")' src = 'images/alphabet/q.png' style='width:50px;height:50px;cursor:pointer'></div>

When clicking on the image, it calls the JS function “addIt(‘q’)” which is defined below:

function addIt(key){
  selectedElement = (document.forms["foo"].elements["focusedField"].value!='')?document.forms["foo"].elements["focusedField"].value:"bar";
  d = document.forms["foo"].elements[selectedElement];
  d.value =  d.value + key;
}

The focusedField is assigned when clicking on the inputbox, which is of password type for the required functionality (the user should not see what he is entering).

<input type='password' name='4_1' id = '4_1' onFocus='document.forms["foo"].elements["focusedField"].value = this.name'/>
  • 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-06-05T07:25:00+00:00Added an answer on June 5, 2026 at 7:25 am

    That’s because you are using field names that starts with a number.

    When you use document.forms["foo"].elements["4_1"], Internet Explorer interprets that as document.forms["foo"].elements[4] and gives you the fifth element in the form.

    Just make the field names starts with a letter, like:

    <input type='password' name='x4_1' id='x4_1' ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just started using EF Code First to implement a simple blog. I
I have to implement a simple hashing algorithm. Input data: Value (16-bit integer). Key
I have to implement simple ray tracing algorithm, but I can not figure out
i have this class called MemoryManager, it is supposed to implement a simple smart
I am working on a college project, where I have to implement a simple
In My Application i have Implement the Simple Gallery Demo. Here i am going
I have a Django application in which I need to implement a simple trending/ranking
I'm trying to implement a simple search function. I have a string array which
I have to implement a simple PGP decryption. Have decided to use 'BouncyCastle' as
I have implement the simple TCP server and TCP client classes which can send

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.