permaculture playing cards*
The moose likes HTML, CSS and JavaScript and the fly likes Replace keycode value in Firefox Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Replace keycode value in Firefox" Watch "Replace keycode value in Firefox" New topic
Author

Replace keycode value in Firefox

Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60
I have the following javascript to tab to the next input box on tab/period
which works fine in Internet Explorer
but in Firefox the . also shows in the input box becoz i am not able to skip the keycode 46 in firefox

please help me on this


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60780
    
  65

Chinni Bujji wrote:... in the input box becoz i am not able to skip the keycode 46 in firefox

Please use real words when posting to the forums. Abbreviations such as "becoz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.

Please read this for more information.

thanks,
bear
JavaRanch sheriff

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
use onkeydown instead of onkeypress [guessing that is what you are using.] Cancel the event and than set focus to the next box.

Eric
Chinni Bujji
Ranch Hand

Joined: Jan 31, 2007
Posts: 60
Yes Eric I am using the key press event
I changed it to keydown but how do i cancel that event and focus

thanks
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Cancel it by using return false and you can focus using focus() on the element

Eric
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Replace keycode value in Firefox
 
Similar Threads
No window.event in firefox ?
Combo box hiding when using jQuery form transformation
IP Address Validation
Error in FF
IE vs FF window.event issue