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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:12:01+00:00 2026-06-09T15:12:01+00:00

I have a web page where I am using a textbox to get the

  • 0

I have a web page where I am using a textbox to get the user’s First name. I am using an onKeyUp handler in it to validate the input for any non-permissible characters and also to check if the user presses the enter key. The textbox is not inside a form.

The input looks like this:

<input type='text' id='userNameBox' onKeyUp='user.checkUserName(event);' />

Here user is the object created from a JavaScript class by name User.

On the webpage, when I click inside the textbox and enter some text, the validation occurs.

The problem I am facing is that I have a console.log in the checkUserName method. It is:

console.log('key pressed='+event.which);

When the focus is in the textbox, some unknown events are getting fired periodically. I keep getting the message key pressed=252 even though I am not pressing any keys. What is the keycode 252 and why is it getting fired on its own? I tried searching for the same but could not get any proper results.

I use Prototype Library in my application.

  • 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-09T15:12:02+00:00Added an answer on June 9, 2026 at 3:12 pm

    Here is a full listing of keyCodes, note that it differs by browser.
    http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/Note-KeyProps.html

    I would recommend against using event.which and use event.keyCode as support for event.which in internet explorer is questionable.

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

Sidebar

Related Questions

new on rails and using windows for now,, i have web page that user
I have a email textbox in my web page. When user submits the page
I have a png graphic that is put in the web page using raphael
I have a web page, that redirects to the desired destination url using: <meta
I'm using Windows Media Player in a web page. I have version 11 installed
Today we have a windows application that, using an OCX, creates a web page
I have this web application using Spring Web Flow framework. In my main page
I have a page based web method which works fine, using [WebMethod], i.e [WebMethod]
I'm using Spring Web Flow (v. 1.0.5) and I have a JSP page that
I have a textbox in asp page which is a concrete view. User enters

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.