File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes event.keyCode for decimal or Period not being validated Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "event.keyCode for decimal or Period not being validated" Watch "event.keyCode for decimal or Period not being validated" New topic
Author

event.keyCode for decimal or Period not being validated

Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

Hi,

Below is the if Condition I have used



But not sure for what reason decimal point and period is not being typed with i do keydown.


http://www.lifesbizzare.blogspot.com || OCJP:81%
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

Dear Bear,

I wrote the above mentioned code snippet in the below jquery keydown function and added the keycode

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60739
    
  65

If you are using jQuery, you should be using event.which to check keys.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Vishal Hegde
Ranch Hand

Joined: Aug 01, 2009
Posts: 1055

Bear Bibeault wrote:If you are using jQuery, you should be using event.which to check keys.


Dear Bear,

Its working. I was going to the wrong JSP page.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: event.keyCode for decimal or Period not being validated
 
Similar Threads
Implementing auto-tabbing
only allow user to enter two digits after decimal
How to make a count down of Characters in a textbox?
Problem With Ctrl C/V in Firefox after validating an input
How to disable Backspace button in IE using JavaScript?